forked from kalenarndt/ace-t-deploy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path002_configure_environment.yml
132 lines (125 loc) · 4.73 KB
/
002_configure_environment.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
121
122
123
124
125
126
127
128
129
130
131
132
---
#
# Playbook to register Compute Manager with NSX Appliance, Create IP Pools
#
#
- hosts: 127.0.0.1
connection: local
become: yes
vars_files:
- answerfiles/first_site.yml
tasks:
- name: Register Compute Manager
nsxt_fabric_compute_managers:
hostname: "{{ nsxt_vip }}"
username: "{{ nsx_username }}"
password: "{{ nsx_password }}"
validate_certs: "{{ validate_certs }}"
display_name: "{{ item.display_name }}"
server: "{{ item.mgmt_ip }}"
origin_type: "{{ item.origin_type }}"
credential:
credential_type: "{{ item.credential_type }}"
username: "{{ item.username }}"
password: "{{ item.password }}"
state: "{{ state }}"
with_items:
- "{{compute_managers}}"
- name: Licensing NSX Manager
nsxt_licenses:
hostname: "{{ nsxt_vip }}"
username: "{{ nsx_username }}"
password: "{{ nsx_password }}"
validate_certs: "{{ validate_certs }}"
license_key: "{{ license_key }}"
state: "{{ state }}"
# Create IP Pools for NSX Edges or ESXi hosts
- name: Create Policy IP Pools
nsxt_policy_ip_pool:
hostname: "{{ nsxt_vip }}"
username: "{{ nsx_username }}"
password: "{{ nsx_password }}"
validate_certs: "{{ validate_certs }}"
display_name: "{{ item.display_name }}"
pool_static_subnets: "{{ item.pool_static_subnets }}"
state: "{{ state }}"
with_items:
- "{{ ip_pools }}"
# Create Uplink Profiles for NSX Edges and ESXi hosts
- name: Create NSX Edge Uplink profiles
nsxt_uplink_profiles:
hostname: "{{ nsxt_vip }}"
username: "{{ nsx_username }}"
password: "{{ nsx_password }}"
validate_certs: False
resource_type: UplinkHostSwitchProfile
display_name: "{{ item.display_name }}"
teaming: "{{ item.teaming }}"
transport_vlan: "{{ item.transport_vlan }}"
mtu: "{{ item.mtu }}"
state: "{{ state }}"
named_teamings: "{{ item.named_teamings }}"
with_items:
- "{{ edge_uplink_profiles }}"
# Create Uplink Profiles for NSX Edges and ESXi hosts
- name: Create ESXi Host Uplink profiles
nsxt_uplink_profiles:
hostname: "{{ nsxt_vip }}"
username: "{{ nsx_username }}"
password: "{{ nsx_password }}"
validate_certs: False
resource_type: UplinkHostSwitchProfile
display_name: "{{ item.display_name }}"
teaming: "{{ item.teaming }}"
transport_vlan: "{{ item.transport_vlan }}"
state: "{{ state }}"
named_teamings: "{{ item.named_teamings }}"
with_items:
- "{{ esxi_uplink_profiles }}"
# Create Transport Zones for NSX Edges and ESXi hosts
- name: Create Transport Zones
nsxt_transport_zones:
hostname: "{{ nsxt_vip }}"
username: "{{ nsx_username }}"
password: "{{ nsx_password }}"
validate_certs: "{{ validate_certs }}"
resource_type: "TransportZone"
display_name: "{{ item.display_name }}"
description: "{{ item.description }}"
transport_type: "{{ item.transport_type }}"
host_switch_name: "{{ item.host_switch_name }}"
uplink_teaming_policy_names: "{{item.uplink_teaming_policy_names}}"
state: "{{ state }}"
with_items:
- "{{ transport_zones }}"
register: tzs
# Create Transport Node Profiles for ESXi hosts
- name: Create Transport Node Profile
nsxt_transport_node_profiles:
hostname: "{{ nsxt_vip }}"
username: "{{ nsx_username }}"
password: "{{ nsx_password }}"
validate_certs: "{{ validate_certs }}"
resource_type: TransportNodeProfile
display_name: "{{ item.display_name }}"
description: "{{ item.description }}"
host_switch_spec:
resource_type: StandardHostSwitchSpec
host_switches: "{{ item.host_switches }}"
state: "{{ state }}"
with_items:
- "{{ transport_node_profiles }}"
# Attach TN Profile to vSphere Cluster and Prepare ESXi
- name: Attach Transport Node Profile to Cluster
nsxt_transport_node_collections:
hostname: "{{ nsxt_vip }}"
username: "{{ nsx_username }}"
password: "{{ nsx_password }}"
validate_certs: "{{ validate_certs }}"
display_name: "TNC"
resource_type: "TransportNodeCollection"
description: "Transport Node Collections Hosts"
compute_manager_name: "{{compute_managers[0].display_name}}"
cluster_name: "{{compute_managers[0].compute_cluster_name}}"
transport_node_profile_name: "{{transport_node_profiles[0].display_name}}"
state: "{{ state }}"