-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_vm_vmware_ask.yml
35 lines (34 loc) · 1.3 KB
/
create_vm_vmware_ask.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
---
- name: Create new VM
hosts: localhost
gather_facts: no
vars:
datacenter_name: cdcug
cluster_name: cluster01
datastore_name: CDCUG_VMware_mgmt_nfs
tasks:
- name: Create new virtual machine on VMware
vmware_guest:
hostname: "{{ lookup('env','VMWARE_HOST') }}"
username: "{{ lookup('env','VMWARE_USER') }}"
password: "{{ lookup('env','VMWARE_PASSWORD') }}"
name: "{{ param_vm_name }}"
template: "{{ param_vm_template }}" # centos76-minimal, rhel7-generic
annotation: "{{ param_vm_annotation }}" # Shows as Notes on VM in vCenter
datacenter: "{{ datacenter_name }}"
cluster: "{{ cluster_name }}" # Is_this_predefined?
datastore: "{{ datastore_name }}" # Is_this_predefined?
folder: / # "{{ param_vm_folder }}" # required
validate_certs: false
state: poweredon
wait_for_ip_address: no
hardware:
num_cpus: "{{ param_vm_num_cpus }}"
memory_mb: "{{ param_vm_memory_mb }}"
networks:
- name: "{{ param_vm_network_name }}" # default: VM Network
device_type: vmxnet3
#- vlan: "{{ param_vm_network_vlan }}" # example: 119
# the next lines belong under networks: - name if activated
# ip: "10.110.111.183" #ip: "{{ ipaddr }}"
# netmask: 255.255.255.0 # required parameter