Hi guys,

Ran a playbook against 2 hosts: host1 and host2

Extract of playbook:

roles:
   - role: a
   - role: b
   - role: c
post_tasks:
   - name: Post Task 1
   ::::::::::::::::::::::::::
   - name: Post Task 2
   ::::::::::::::::::::::::::
   - name: Post Task 3
   ::::::::::::::::::::::::::

In role c the main task is like:

---
- block:
   - include: x.yml
   - include: y.yml
   - include: z.yml
  rescue:
   - fail: msg="There was a failure in main!!"


y.yml is like:

---
- block:
   - name: Task 1
   ::::::::::::::::::::::::::
   - name: Task 2
   ::::::::::::::::::::::::::
   - name: Task 3
   ::::::::::::::::::::::::::
  rescue:
   - fail: msg="There was a failure in y!!"


host2 failed a task in y.yml. As expected all other tasks in z.yml were 
executed for host1

However, neither host1 or host2 executed any of the post tasks. I did not 
expect this to be the behavior. I thought host1 should execute the post 
tasks.

Could anybody please help me to understand why this happens and suggest how 
to make sure the post_tasks execute for hosts which have not had any role 
task failures?
Preferably while still using post_tasks. 

Thanks a lot,
Daniel

-- 
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/092d0725-b497-4f87-a019-f3cd343e8279%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to