Skip to content

Instantly share code, notes, and snippets.

@Kahn
Created March 24, 2014 01:42
Show Gist options
  • Save Kahn/9732765 to your computer and use it in GitHub Desktop.
Save Kahn/9732765 to your computer and use it in GitHub Desktop.
ansible-vsphere_guest playbook
# Note: vcenter_username and vcenter_password are contained in a ansible-vault file create_dev_server-vault.yml
- hosts: 127.0.0.1
connection: local
user: username
sudo: false
gather_facts: false
serial: 1
vars_files:
- create_dev_server-vault.yml
tasks:
- vsphere_guest:
vcenter_hostname: '192.168.1.1'
user: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
datastore: 'datastore2'
esxi_hostname: '192.168.1.1'
datacenter: '192.168.1.1'
vm_name: 'ansibletest'
vm_memory_mb: 2048
vm_num_cpus: 1
vm_notes: 'Provisioned by Ansible'
guestosid: 'rhel6_64Guest'
power_on: yes
vm_extra_config:
vcpu.hotadd: 'TRUE'
mem.hotadd: 'TRUE'
vm_disk:
disk1:
size_gb: 20
datastore: "datastore2"
type: "thin"
vm_nic:
nic1:
type: "e1000"
network: "SERVERS"
network_type: "standard"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment