Skip to content

Instantly share code, notes, and snippets.

@neilhwatson
Created December 22, 2016 17:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neilhwatson/6c659c2300717bcd4a1c35f2793e249a to your computer and use it in GitHub Desktop.
Save neilhwatson/6c659c2300717bcd4a1c35f2793e249a to your computer and use it in GitHub Desktop.
- name: Create VM from template
vmware_guest:
validate_certs: False
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_user }}"
password: "{{ vcenter_pass }}"
#esxi_hostname: "{{ esxhost }}"
#datacenter: BOX
name: "{{ name }}"
template: "{{ vmtemplate }}"
disk:
- size_gb: 20
type: thin
datastore: "{{ datastore }}"
nic:
- type: vmxnet3
network: "{{ network }}"
hardware:
memory_mb: "{{ vm_memory | default(1024) }}"
wait_for_ip_address: True
state: present
register: newvm
- name: IP address info
debug:
msg: "{{ newvm.instance.ipv4 }} {{ name }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment