I am using ansible to create instances in EC2. I set disableApiTermination to true using an AWS CLI invocation for each instance that I create (On that note, I hope https://github.com/ansible/ansible-modules-core/pull/205 gets accepted into the devel branch soon).
However, I would like to unset it for any instances for which playbook execution fails. So that I may terminate those instances promptly after the playbook run. In fact if this facility were to be added to ansible, I could even put the termination call right there, so that at the end of the playbook run, I would only have the instances for which everything ran smoothly, and the ones for which things failed would have already been terminated. So basically I am looking for the equivalent of an except block, something that would allow me to define tasks (even roles perhaps?) for inventory items that registered failure and for which ansible would stop executing the rest of the playbook. This could be helpful in any kind of cleanup/rollback task. If there is already something that allows doing this, I would appreciate pointers towards it. Regards, Sankalp -- 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 ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/a5bf24b5-b06a-446e-b2d3-27511198e312%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.