Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dfetterman/6d29da0e95f7009d0eae84f874345e09 to your computer and use it in GitHub Desktop.
Save dfetterman/6d29da0e95f7009d0eae84f874345e09 to your computer and use it in GitHub Desktop.
Ansible Example vmware_guest provision without network
- name: "Ensure that virtual machine exists in VMC SDDC"
vmware_guest:
datacenter: "SDDC-Datacenter"
hostname: "{{ vsphere_server }}"
username: "{{ vsphere_user }}"
password: "{{ vsphere_password }}"
validate_certs: no
folder: "/SDDC-Datacenter/vm/Workloads"
name: "ansible-test-rhel-Demo1"
annotation: "This is a test VM created by Ansible"
state: poweredon
# state: absent
# state: poweredoff
# state: present
resource_pool: "Compute-ResourcePool"
# template: "Ansible-test-fromiso6"
template: "RHEL7-rootpwwasreset"
# guest_id: centos7_64Guest
guest_id: rhel6_64Guest
disk:
- size_gb: 64
type: thin
datastore: WorkloadDatastore
hardware:
memory_mb: 1024
num_cpus: 2
scsi: paravirtual
# networks:
# - name: "Host Segment 1 DHCP"
# start_connected: true
# wait_for_ip_address: yes
delegate_to: localhost
register: deploy_vm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment