Skip to content

Instantly share code, notes, and snippets.

@neilhwatson
Created December 22, 2016 17:13
Show Gist options
  • Save neilhwatson/6c659c2300717bcd4a1c35f2793e249a to your computer and use it in GitHub Desktop.
Save neilhwatson/6c659c2300717bcd4a1c35f2793e249a to your computer and use it in GitHub Desktop.

Revisions

  1. neilhwatson created this gist Dec 22, 2016.
    28 changes: 28 additions & 0 deletions vguest.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@


    - 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 }}"