I've done things like this before with some success:
playbook:$ cat roles/ci/tasks/main.yml --- - include: deploy.yml when: ci_rollback is not defined or ci_rollback == "" - include: rollback.yml when: ci_rollback is defined and ci_rollback != "" playbook:$ and then if you need to uninstall, just set ci_rollback=yowza during ansible invocation. On 14 March 2016 at 20:24, 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. > 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/CAK5eLPQqiHTTs2hEiBnHgLD-Gra-Y51X4yk5UZHU62CjH9FV7A%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
