On 19. juli 2016 23:28, Jon Murillo wrote:
> How can I use this *when* function to work with the hosts in my inventory
> file? I had *when: inventory_hostname == play_hosts[0]* but I notice that
> it only selects a random server. I want it to select all of the servers.
> Using a * doesn't work..
I don't understand why you want to do this, inventory_hostname will
always be in play_hosts, so it will always be true.
Maybe you are looking for "with_items: play_hosts"?
To check if something is in a list the syntax is
when: <variable> in <list>
--
Kai Stian Olstad