This is a question I've pondered in my own work. There is no one specific or recommended way Ansible prescribes for doing this. What follows are my own personal thoughts and mine alone.
You can do separate role as you suggest. Not ideal because it puts to much distance between closely related functionality for my liking. You could tag tasks one or the other -- however you must remember to pass a tag. No sure this is practical in that it's too easy to mess up. You can implement something with some combinations of params/variables, conditionals, includes and/or blocks. This is one I think has the most promise though the number of ways this could be implemented are pretty extensive in number. <tim/> Timothy Appnel Principal Architect Ansible by Red Hat +1 718.404.6429 | <+1+718.404.6429> ansible.com <https://www.ansible.com/> GitHub: tima <https://www.github.com/tima> Twitter: @appnelgroup <https://www.twitter.com/@appnelgroup> On Mon, Mar 14, 2016 at 4:24 PM, Gilberto Valentin <[email protected]> wrote: > I am creating a role with *ansible-galaxy init role_name*. One of the > tasks in that role will be to install_app.yml and another to remove_app.yml > (one to install and one to remove). Is it possible to call one task vs the > other within that role or do I need to create a whole new role for that > specific task? > > -- > You received this message because you are subscribed to the Google Groups > "Ansible Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/77c726a2-29ea-4898-ab05-32b82d5af207%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/77c726a2-29ea-4898-ab05-32b82d5af207%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAOMCme5iuYHT_Hi%3DA%3DRR4eDk3mPjnSGcTyB7fSiN3%3DV1pQFR6w%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
