-
Notifications
You must be signed in to change notification settings - Fork 0
/
createVM.yml
41 lines (40 loc) · 1.12 KB
/
createVM.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
36
37
38
39
40
41
---
- name: Create a VM from a template
hosts: localhost
gather_facts: no
tasks:
- name: Clone the Template
vmware_guest:
hostname: "{{lookup('env', 'VMWARE_HOST')}}"
username: "{{lookup('env', 'VMWARE_USER')}}"
password: "{{lookup('env', 'VMWARE_PASSWORD')}}"
datacenter: DC
cluster: CL
name: "{{vmname}}{{item}}"
folder: /DC/vm
template: "{{template}}"
networks:
- name: VM Network
type: dhcp
state: poweredon
datastore: NFS
validate_certs: no
with_sequence: count={{number|int - 1}}
- name: Clone the Template with wait for customization
vmware_guest:
hostname: "{{lookup('env', 'VMWARE_HOST')}}"
username: "{{lookup('env', 'VMWARE_USER')}}"
password: "{{lookup('env', 'VMWARE_PASSWORD')}}"
datacenter: DC
cluster: CL
name: "{{vmname}}{{number}}"
folder: /DC/vm
template: "{{template}}"
networks:
- name: VM Network
type: dhcp
state: poweredon
datastore: NFS
validate_certs: no
wait_for_ip_address: yes
# wait_for_customization: yes