"Actually I think that he is trying to configure something for a group of
hosts rather than configure something on a group of hosts."

Still:

   - hosts: whichever

       - local_action: shell echo one host name name is {{ item }}
         with_items: groups.monitoring




On Thu, May 1, 2014 at 10:24 AM, Adam Morris <[email protected]> wrote:

> Actually I think that he is trying to configure something for a group of
> hosts rather than configure something on a group of hosts.  For example
> lets assume that you have a DHCP server and you want to configure static ip
> addresses for each of your servers. You could run through each host
> grabbing all of the MAC addresses and IP addresses from each server but you
> would only be configuring them on one server.
>
> I am not saying that that is the case and I am curious as to what the case
> is, but that is an example of what I think we are being asked for here.
> On Apr 29, 2014 11:36 AM, "nZac" <[email protected]> wrote:
>
>> "I want is simply to have the task run for each item in  "mylist" for
>> each host in "somegroup"."
>>
>> Ansible loops through your groups and hosts and executes tasks against
>> them. Therefore there is no need to manage an outer loop, Ansible does it
>> for you and is central to how Ansible works.
>>
>> "Thus, have the task run for 5 times: for item1, item2, item3, item4 and
>> item5."
>>
>> This inner loop is as simple as with_items as already suggested.
>>
>> Does that help or did I confuse you more?
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Ansible Project" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/ansible-project/RQYOP_yR5Yk/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, 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/bb796dfb-cda9-49d4-97e7-a9c3def2febd%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>  --
> 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/CAGvoTo0VHvmLmnPVqftWHrHVbuFXhD6b4soGyUf3mkz_uEXRfA%40mail.gmail.com<https://groups.google.com/d/msgid/ansible-project/CAGvoTo0VHvmLmnPVqftWHrHVbuFXhD6b4soGyUf3mkz_uEXRfA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CA%2BnsWgwEV%2BZqENDrR__hGXS0Gg1NZcd8s2D3hBv_TqHE4%2BQXRw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to