Tomasz Kontusz <[email protected]> napisał:
>
>
>Anand Buddhdev <[email protected]> napisał:
>>On Monday, August 25, 2014, Tom Bamford <[email protected]> wrote:
>>
>>Hi Tom,
>>
>>The only issue for me is that ansible-playbook displays a skipped
>>status
>>> for each task it doesn't run for a host instead of just ignoring
>>them.
>>>
>>
>>Thanks for your suggestion. That does work, but as you said, ansible
>>still
>>evaluates and skips all the tasks if the when: condition evaluates to
>>false. With a long task list that results in a lot of unnecessary
>>skips.
>>
>>I'm hoping the developers have some clever ideas to solve this.
>>
>>Anand
>
>Another way to do this is to split your role in two, and have separate
>plays for CentOS 6 and 7. You can still have Ansible detect which host
>should run which play by grouping them with group_by:
>
>- hosts: all
>  tasks:
>  - group_by: key=CentOS_{{ansible_distribution_version}}
>
>- hosts: CentOS_7
>  roles:
>  - firewalld
>
>- hosts: all
Ugh, hosts: CentOS_6 obviously :-)

>  roles:
>  - firewall_iptables
>
>-- 
>Wysłane za pomocą K-9 Mail.

-- 
Wysłane za pomocą K-9 Mail.

-- 
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/da5ee9fa-f0be-4d4f-bba0-b299159dbb30%40email.android.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to