Thank you very much, Brian and Mark. I have been using the with_items
approach and providing the VM names from a static file. Since we use
Ansible Tower, these files are fetched from a git repository. We also use
the roles way of doing things and being relatively new to Ansible, I am
little confused about how to go ahead here.
I believe in your cases, you define the hostnames in the hosts file saved
inside the Ansible Server or a common location. I was trying to figure out
how do I achieve the same thing in my case where the hostnames are in the
git repository i.e., how do I specify that in the ansible.cfg file?
Can you suggest the best approach here - saving the hostnames inside the
Ansible server Vs. fetching that from a Git repository during the job run?
In my case
On Wednesday, 21 December 2016 01:25:19 UTC+5:30, Mark Phillips wrote:
>
>
> On Tuesday, 20 December 2016 19:53:01 UTC, Brian Coca wrote:
>>
>> I was going for even simpler:
>>
>
> Dude, you rock!
>
>
>
>
>>
>> # inventory
>>
>> [vm_group]
>> host[1-50] ansible_connection=local
>>
>> # play
>> - hosts: vm_group
>> gather_facts: false
>> tasks:
>> - create_vm: name={{inventory_hostname} ....
>> delegate_to: localhost
>>
>>
>> ----------
>> Brian Coca
>>
>
--
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/3b1902a9-dc7f-4f06-b9cb-ff44b4f3b5f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.