Hi,

Actually I'm only getting this behavior when using the ansible integration 
for StackStorm https://github.com/StackStorm-Exchange/stackstorm-ansible

Running this playbook using plain ansible behaves as I expected it would 
i.e. host1 executes post_tasks.

Cheers,
Daniel

On Wednesday, November 29, 2017 at 2:12:03 PM UTC+11, Daniel Leonard wrote:
>
> 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/a886fb20-cfa4-4178-bb04-606c7ce11f80%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to