---
# 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 }}"---
vmname81:
- Client1
- Client2
- Client3
vmname10:
- Client4
- Client5---
# To Create VMs on the VMware vCenter Server
- hosts: localhost
name: Creation of Windows 8.1 VMs
roles:
- { role: vmcreation }---
windows_vms:
- Client1
- Client2
- Client3
---
windows_vms:
- Client4
- Client5---
# To Create VMs on the VMware vCenter Server
- include_vars: "vars/windows{{ windows_ver }}.yml"
- 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: "{{ windows_vms }}"
---
# To Create VMs on the VMware vCenter Server
- hosts: localhost
name: Creation of Windows 8.1 VMs
roles:
- { role: vms, windows_ver: 81 } # to create the windows in vars/windows81.yml
- { role: vms, windows_ver: 10 } # to create the windows in vars/windows10.yml
- include_vars: "vars/vmname{{ windows_ver }}.yml"