forked from rbales79/Ansible-Swarm-Deploy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vm-create.yml
60 lines (60 loc) · 1.46 KB
/
vm-create.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
- name: Create a VM from a template
hosts: localhost
connection: local
gather_facts: no
tasks:
- name: test01
vmware_guest:
hostname: 172.16.1.5
username: [email protected]
password: VMware1!
validate_certs: False
name: web02
template: centos7-base
datacenter: rlab-datacenter01
folder: ansible-vms
cluster: rlab-cluster01
datastore: esx01-ds
networks:
- name: mgmt-trunk
ip: 172.16.1.200
netmask: 255.255.255.0
gateway: 172.16.1.1
type: static
dns_servers: 172.16.1.1
customization:
hostname: "web02"
dns_servers:
- 172.16.1.1
- 192.168.88.1
state: poweredon
wait_for_ip_address: yes
delegate_to: localhost
- name: test02
vmware_guest:
hostname: 172.16.1.5
username: [email protected]
password: VMware1!
validate_certs: False
name: web03
template: centos7-base
datacenter: rlab-datacenter01
folder: ansible-vms
cluster: rlab-cluster01
datastore: esx01-ds
networks:
- name: mgmt-trunk
ip: 172.16.1.201
netmask: 255.255.255.0
gateway: 172.16.1.1
type: static
dns_servers: 172.16.1.1
customization:
hostname: "web03"
dns_servers:
- 172.16.1.1
- 192.168.88.1
state: poweredon
wait_for_ip_address: yes
delegate_to: localhost