Hi Kai, The playbook works perfectly now. Thanks again for all your help.
Regards, Alex On Thu, Feb 16, 2017 at 7:26 AM, Kai Stian Olstad < [email protected]> wrote: > On 15. feb. 2017 22:13, Alex Lien wrote: > >> Hi Kai, >> >> Thank You so much for your help. The loop works with your suggestions >> except it seems to run a duplicate task and create a duplicate guest. >> This >> is with a test of 2 ESX hosts. Is there a way to work around it? >> >> This is what I have in my inventory: >> >> [esxi] >> esxi1 >> esxi4 >> >> # ansible-playbook --limit esxi cr_guests.yml >> >> PLAY [all] >> ********************************************************************* >> > > Since you inventory contain two hosts it will run the task two times, one > time for each hosts. > You only wanna run it once so in your playbook set "- hosts: localhost" > and remove the line "connection: local" > > -- > Kai Stian Olstad > > -- > 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/to > pic/ansible-project/m3bKGT4MIno/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/ms > gid/ansible-project/23048cd8-06f3-c44f-8861-cf8b6f04d97c%40olstad.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/CAJGf5rzzoVV8jmgOGk4tnGViP6zRN%3D%2Bt2R712zrG66%3Dp73LXsg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
