September 2018
Beginner to intermediate
214 pages
5h 53m
English
This use case shows how to create virtual machines from a predefined template. After that, we make sure that all the VMs have been added to the inventory with the right parameters:
---- name: Create a virtual machine from a template hosts: localhost gather_facts: False tasks: - name: Create a virtual machine vmware_guest: hostname: 'vcenter.edu.lab' username: 'vmadmin@lab.edu' password: 'VMp@55w0rd' datecenter: 'vcenter.edu.lab' validate_certs: no esxi_hostname: 'esxi1.lab.edu' template: ubuntu1404Temp folder: '/DeployedVMs' name: '{{ item.hostname }}' state: poweredon disk: - size_gb: 50 type: thin datastore: 'datastore1' networks: - name: 'LabNetwork' ip: '{{ item.ip }}' netmask: '255.255.255.0' ...Read now
Unlock full access