Hi,

when: inventory_hostname in groups['small_group']

Or

when: inventory_hostname == {{ windows_hostname1 }}



On Fri, 18 Sep 2020, 13:24 [email protected], <[email protected]>
wrote:

>
> I have tried to maintain my main yml file like below
>        ----
>         hosts: "{{ windows_hostname1 }}"
>         gather_facts: no
>         roles:
>           - Windows
>
>         hosts: "{{ windows_hostname2 }}"
>         gather_facts: no
>         roles:
>           - Windows
>
> and my tasks are inside the windows role with same tag name is there any
> chance of putting when condition to this hosts variable in tasks so I can
> diffrentiate the execution for two windows hosts.
>
> I have two windows devices which deals differenct tasks.
>
> Thanks in advance.
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/3dbdf35b-0b0e-40f4-82d1-b98787a12e6fn%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/3dbdf35b-0b0e-40f4-82d1-b98787a12e6fn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAG_8SgO8iJo4LZFR3vrc4jLbWoqDhWPi0qr-cBfcWBd72HGmMw%40mail.gmail.com.

Reply via email to