Re: [ansible-project] do post_tasks execute when a role fails?

2017-12-08 Thread Niels Bertram
Hmm if I had to develop specific error handling around roles, I would use the block statement . Have not been able to come up with something that I could not handle. N tasks: - block: - include_role: name:

Re: [ansible-project] do post_tasks execute when a role fails?

2017-09-03 Thread Josh Smift
Does 'meta: clear_host_errors' help in this situation? http://docs.ansible.com/ansible/latest/playbooks_error_handling.html#resetting-unreachable-hosts only mentions this as affecting unreachable hosts, but http://docs.ansible.com/ansible/latest/meta_module.html mentions that it clears the failed

Re: [ansible-project] do post_tasks execute when a role fails?

2017-08-31 Thread ssbarnea
Sorry to revive this old thread but I (and many others) got the same problem which seems not to be addressed yet. My original post was at https://stackoverflow.com/questions/45983636/how-to-always-run-some-ansible-roles-after-previous-failures If you you wrote is still true (ansible 2.3.x), it

Re: [ansible-project] do post_tasks execute when a role fails?

2016-12-01 Thread Kai Stian Olstad
On 01. des. 2016 14:31, sergio.guil...@mojix.com wrote: Hi, I created a role that has a rescue block where role is marked as failed: --- #myrole - block: ... rescue: - fail: msg='some message' #mark as fail ansible_failed_task is defined When ever Ansible run the fail module, it will

Re: [ansible-project] do post_tasks execute when a role fails?

2016-12-01 Thread Brian Coca
I forgot, there is also a 'always' section to blocks that runs tasks no matter the previous state. -- Brian Coca -- 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

Re: [ansible-project] do post_tasks execute when a role fails?

2016-12-01 Thread Brian Coca
To clarify as the question indicates some misunderstanding, roles can only fail on import, what is failing is a task (which happens to be in a role)​. Tasks in post_tasks, are just like any other task, the only difference is ordering, they get executed after all previous tasks/role sections.

[ansible-project] do post_tasks execute when a role fails?

2016-12-01 Thread sergio . guillen
Hi, I created a role that has a rescue block where role is marked as failed: --- #myrole - block: ... rescue: - fail: msg='some message' #mark as fail ansible_failed_task is defined On my playbook the idea is to send notification if ansible_failed_task is defined that's why "myrole"