On Thursday, February 15, 2018 at 12:51:23 PM UTC-5, Michael Perzel wrote:
>
> Gah not quite there. I use meta_end play when I calculate that a patch 
> isn't relevant so that we don't spend time decomissioning a host that 
> doesn't need a patch. Problem is this skips the post_tasks if the last 
> server in the group isn't relevant. I tried using handlers but that results 
> in 1 execution per node.
>
> I think I might need to re-think my playbook organization and simplify. I 
> could use a workflow in tower to accomplish this simpler without skipped 
> tasks.
>

Since you want to run 3 sets of tasks on different sets of servers it would 
be a lot cleaner to split your playbook into three plays instead of one:

- hosts: patchgroup[0]
  tasks:
    - debug: msg=pre

- hosts: patchgroup
  serial: 1
  tasks:
     - debug: msg=patch

- hosts: patchgroup[0]
  tasks:
    - debug: msg=post 

This way you won't have a bunch of skipped tasks and you can end_play 
during patching without affecting your post tasks, since they're a separate 
play.

-- 
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/d4d5647c-f986-4bde-b34f-8dab00a85b3b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to