forked from vmware/ansible-for-nsxt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_basic_topology.yml
186 lines (176 loc) · 6.17 KB
/
test_basic_topology.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# Copyright 2018 VMware, Inc.
# SPDX-License-Identifier: BSD-2-Clause OR GPL-3.0-only
---
- hosts: 127.0.0.1
connection: local
become: yes
vars_files:
- answerfile.yml
tasks:
- name: deploy NSX Manager OVA
nsxt_deploy_ova:
ovftool_path: "/usr/bin"
datacenter: "private_dc"
datastore: "data store"
portgroup: "VM Network"
cluster: "nsxt_cluster"
vmname: "nsxt-manager"
hostname: "nsxt-manager-10"
dns_server: "20.162.244.213"
dns_domain: "eng.vmware.com"
ntp_server: "123.110.200.124"
gateway: "10.112.203.253"
ip_address: "40.112.201.24"
netmask: "255.255.224.0"
admin_password: "Admin!23Admin"
cli_password: "Admin!23Admin"
path_to_ova: "http://build-squid.eng.vmware.com/build/mts/release/bora-8411846/publish/nsx-unified-appliance/exports/ovf"
ova_file: "nsx-unified-appliance-2.2.0.0.0.8411854.ovf"
vcenter: "10.161.244.213"
vcenter_user: "[email protected]"
vcenter_passwd: "Admin!23"
deployment_size: "small"
role: "nsx-manager nsx-controller"
- name: Check manager status
nsxt_manager_status:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: False
wait_time: 50
- name: Deploy compute manager
nsxt_fabric_compute_managers:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: False
display_name: "vCenter"
server: "10.161.244.213"
origin_type: vCenter
credential:
credential_type: UsernamePasswordLoginCredential
username: "[email protected]"
password: "Admin!23"
thumbprint: "36:43:34:D9:C2:06:27:4B:EE:C3:4A:AE:23:BF:76:A0:0C:4D:D6:8A:D3:16:55:97:62:07:C2:84:0C:D8:BA:66"
state: present
register: compute_manager
- name: Deploy controller
nsxt_controllers:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: False
deployment_requests:
- roles:
- CONTROLLER
form_factor: "MEDIUM"
user_settings:
cli_password: "Admin!23Admin"
root_password: "Admin!23Admin"
deployment_config:
placement_type: VsphereClusterNodeVMDeploymentConfig
vc_id: "{{compute_manager.id}}"
management_network_id: "network-44"
hostname: "controller-1"
compute_id: "domain-c49"
storage_id: "datastore-43"
default_gateway_addresses:
- 11.122.203.253
management_port_subnets:
- ip_addresses:
- 11.142.201.25
prefix_length: "19"
clustering_config:
clustering_type: ControlClusteringConfig
shared_secret: "123456"
join_to_existing_cluster: false
state: present
- name: Add fabric node
nsxt_fabric_nodes:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: False
resource_type: "HostNode"
#node_id: "fefc3fed-84d9-4170-bf7c-5d7438ba91e9"
display_name: "{{item.display_name}}"
ip_addresses: "{{item.ip_addresses}}"
os_type: "{{item.os_type}}"
os_version: "{{item.os_version}}"
host_credential:
username: "{{item.host_username}}"
password: "{{item.host_password}}"
thumbprint: "{{item.host_thumbprint}}"
state: "present"
with_items:
- "{{fabric_host_nodes}}"
- name: Create ip pool
nsxt_ip_pools:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: False
display_name: "{{item.display_name}}"
subnets: "{{item.subnets}}"
state: present
with_items:
- "{{ip_pools}}"
- name: Create transport zone
nsxt_transport_zones:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: False
resource_type: "TransportZone"
display_name: "{{item.display_name}}"
description: "NSX configured Test Transport Zone"
transport_type: "{{item.transport_type}}"
host_switch_name: "{{item.host_switch_name}}"
#zone_id: "21ff0e36-1624-4c18-be2f-070513079185"
state: "present"
with_items:
- "{{transportzones}}"
# - name: Create logical switch
# nsxt_logical_switches:
# hostname: "{{hostname}}"
# username: "{{username}}"
# password: "{{password}}"
# validate_certs: False
# display_name: "test_lswitch"
# replication_mode: SOURCE
# admin_state: UP
# transport_zone_id: "{{transport_zone.id}}"
# state: "present"
# register: logical_switch
- name: Create uplink profile
nsxt_uplink_profiles:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: False
resource_type: UplinkHostSwitchProfile
display_name: "{{item.display_name}}"
mtu: 1600
teaming: "{{item.teaming}}"
transport_vlan: "{{item.transport_vlan}}"
state: "present"
with_items:
- "{{uplink_profiles}}"
- name: Create transport node
nsxt_transport_nodes:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: False
resource_type: TransportNode
display_name: "{{item.display_name}}"
description: NSX configured Test Transport Node
host_switch_spec:
resource_type: StandardHostSwitchSpec
host_switches: "{{item.host_switches}}"
transport_zone_endpoints: "{{item.transport_zone_endpoints}}"
fabric_node_name: "{{item.fabric_node_name}}"
state: present
with_items:
- "{{transport_nodes}}"
#- debug: var=deploy_nsx_ova