-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdeploy_ovas.yml
122 lines (120 loc) · 5.63 KB
/
deploy_ovas.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
---
- name: Deploy NSX-T OVAs
hosts: localhost
gather_facts: False
tasks:
- name: deploy NSX Managers
deploy_ova:
ovftool_path: "{{ hostvars['localhost'].ovfToolPath }}"
datacenter: "{{ hostvars[item]['dc'] }}"
datastore: "{{ hostvars[item]['datastore'] }}"
portgroup: "{{ hostvars[item]['portgroup'] }}"
cluster: "{{ hostvars[item]['cluster'] }}"
vmname: "{{ hostvars[item]['vmname'] }}"
hostname: "{{ hostvars[item]['hostname'] }}"
dns_server: "{{ hostvars['localhost'].dns_server }}"
dns_domain: "{{ hostvars['localhost'].dns_domain }}"
ntp_server: "{{ hostvars['localhost'].ntp_server }}"
gateway: "{{ hostvars[item]['gw'] }}"
ip_address: "{{ hostvars[item].ansible_ssh_host }}"
netmask: "{{ hostvars[item]['mask'] }}"
admin_password: "{{ hostvars[item].ansible_ssh_pass }}"
cli_password: "{{ hostvars[item].ansible_ssh_pass }}"
ssh_enabled: "{{ hostvars['localhost'].sshEnabled }}"
allow_ssh_root_login: "{{ hostvars['localhost'].allowSSHRootAccess }}"
path_to_ova: "{{ hostvars['localhost'].nsxOvaPath }}"
ova_file: "{{ hostvars['localhost'].managerOva }}"
vcenter: "{{ hostvars['localhost'].deployVcIPAddress }}"
vcenter_user: "{{ hostvars['localhost'].deployVcUser }}"
vcenter_passwd: "{{ hostvars['localhost'].deployVcPassword }}"
deployment_size: "{{ hostvars['localhost'].nsx_t_mgr_deploy_size }}"
with_items: "{{ groups['nsxmanagers'] }}"
async: 7200
poll: 0
register: deploy_nsx_man
- name: Wait 4 minutes before start deploying controllers
pause: minutes=4
- name: deploy NSX Controllers
deploy_ova:
ovftool_path: "{{ hostvars['localhost'].ovfToolPath }}"
datacenter: "{{ hostvars[item]['dc'] }}"
datastore: "{{ hostvars[item]['datastore'] }}"
portgroup: "{{ hostvars[item]['portgroup'] }}"
cluster: "{{ hostvars[item]['cluster'] }}"
vmname: "{{ hostvars[item]['vmname'] }}"
hostname: "{{ hostvars[item]['hostname'] }}"
dns_server: "{{ hostvars['localhost'].dns_server }}"
dns_domain: "{{ hostvars['localhost'].dns_domain }}"
ntp_server: "{{ hostvars['localhost'].ntp_server }}"
gateway: "{{ hostvars[item]['gw'] }}"
ip_address: "{{ hostvars[item].ansible_ssh_host }}"
netmask: "{{ hostvars[item]['mask'] }}"
admin_password: "{{ hostvars[item].ansible_ssh_pass }}"
cli_password: "{{ hostvars[item].ansible_ssh_pass }}"
ssh_enabled: "{{ hostvars['localhost'].sshEnabled }}"
allow_ssh_root_login: "{{ hostvars['localhost'].allowSSHRootAccess }}"
path_to_ova: "{{ hostvars['localhost'].nsxOvaPath }}"
ova_file: "{{ hostvars['localhost'].controllerOva }}"
vcenter: "{{ hostvars['localhost'].deployVcIPAddress }}"
vcenter_user: "{{ hostvars['localhost'].deployVcUser }}"
vcenter_passwd: "{{ hostvars['localhost'].deployVcPassword }}"
with_items: "{{ groups['nsxcontrollers'] }}"
async: 7200
poll: 0
register: deploy_nsx_ctrl
- name: Wait 3 minutes before start deploying Edges
pause: minutes=3
- name: deploy NSX Gw OVA
deploy_ova:
ovftool_path: "{{ hostvars['localhost'].ovfToolPath }}"
datacenter: "{{ hostvars[item]['dc'] }}"
datastore: "{{ hostvars[item]['datastore'] }}"
portgroup: "{{ hostvars[item]['portgroup'] }}"
portgroup_ext: "{{ hostvars[item]['portgroupExt'] }}"
portgroup_transport: "{{ hostvars[item]['portgroupTransport'] }}"
cluster: "{{ hostvars[item]['cluster'] }}"
vmname: "{{ hostvars[item]['vmname'] }}"
hostname: "{{ hostvars[item]['hostname'] }}"
dns_server: "{{ hostvars['localhost'].dns_server }}"
dns_domain: "{{ hostvars['localhost'].dns_domain }}"
ntp_server: "{{ hostvars['localhost'].ntp_server }}"
gateway: "{{ hostvars[item]['gw'] }}"
ip_address: "{{ hostvars[item].ansible_ssh_host }}"
netmask: "{{ hostvars[item]['mask'] }}"
admin_password: "{{ hostvars[item].ansible_ssh_pass }}"
cli_password: "{{ hostvars[item].ansible_ssh_pass }}"
ssh_enabled: "{{ hostvars['localhost'].sshEnabled }}"
allow_ssh_root_login: "{{ hostvars['localhost'].allowSSHRootAccess }}"
path_to_ova: "{{ hostvars['localhost'].nsxOvaPath }}"
ova_file: "{{ hostvars['localhost'].edgeOva }}"
vcenter: "{{ hostvars['localhost'].deployVcIPAddress }}"
vcenter_user: "{{ hostvars['localhost'].deployVcUser }}"
vcenter_passwd: "{{ hostvars['localhost'].deployVcPassword }}"
deployment_size: "{{ hostvars['localhost'].nsx_t_edge_deploy_size }}"
with_items: "{{ groups['nsxedges'] }}"
async: 7200
poll: 0
register: deploy_nsx_edges
- name: Wait 10 minutes before start verifying the deployment
pause: minutes=10
- name: Check if NSX Managers deployment has finished
async_status:
jid: "{{ item.ansible_job_id }}"
register: job_result
until: job_result.finished
with_items: "{{ deploy_nsx_man.results }}"
retries: 10
- name: Check if NSX Edges deployment has finished
async_status:
jid: "{{ item.ansible_job_id }}"
register: job_result
until: job_result.finished
with_items: "{{ deploy_nsx_edges.results }}"
retries: 10
- name: Check if NSX Controllers deployment has finished
async_status:
jid: "{{ item.ansible_job_id }}"
register: job_result
until: job_result.finished
with_items: "{{ deploy_nsx_ctrl.results }}"
retries: 10