Thanks for the input. I think I am going to start by creating two separate roles (one for install and one for removal). When I gain enough knowledge of Ansible, I'll add some conditions within one role to execute one task vs the other.
On Monday, March 14, 2016 at 5:31:40 PM UTC-4, Timothy Appnel wrote: > > 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 | 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] > <javascript:>> 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] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> 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/110cfbd6-8460-43cb-b84a-1965b43d39ea%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
