What is your file structure? You show a vms role, but not a vmcreation
role, but yet your playbook includes the vmcreation role?
On Friday, September 23, 2016 at 5:25:29 AM UTC-4, Chethan S wrote:
>
> I am in the process of migrating to Ansible roles model and I have the
> following structure -
>
> *../roles/vms/tasks/main.yml*
> ---
> # To Create VMs on the VMware vCenter Server
> - name: Creation of Windows 8.1 VMs
> vsphere_guest:
> vcenter_hostname: "name"
> guest: "{{ item }}"
> from_template: yes
> template_src: "templatename"
> validate_certs: no
> esxi:
> datacenter: dc
> hostname: hname
> with_items: "{{ vmname81 }}"
>
> *../roles/vms/vars/main.yml*
> ---
> vmname81:
> - Client1
> - Client2
> - Client3
>
>
> vmname10:
> - Client4
> - Client5
>
>
> *playbook.yml*
> ---
> # To Create VMs on the VMware vCenter Server
> - hosts: localhost
> name: Creation of Windows 8.1 VMs
> roles:
> - { role: vmcreation }
>
> As you can see in the playbook, I am trying to create Windows 8.1 VMs and
> I am unable to figure out how to pass the *vmname81* in the roles for the
> creation of 8.1 VMs. I am also interested to know if this can be done in a
> better way.
>
--
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/c203d2c2-4564-4e1f-89a5-6981cd6b8ed3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.