forked from vmware/ansible-for-nsxt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_attach_tnp_to_cluster.yml
99 lines (94 loc) · 3.2 KB
/
test_attach_tnp_to_cluster.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
# 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_attach_tnp_to_cluster.yml
tasks:
- name: Register compute manager
nsxt_fabric_compute_managers:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: False
display_name: "{{item.display_name}}"
server: "{{item.server}}"
origin_type: "{{item.origin_type}}"
credential:
credential_type: "{{item.credential_type}}"
username: "{{item.username}}"
password: "{{item.password}}"
thumbprint: "{{item.thumbprint}}"
state: present
with_items:
- "{{compute_managers}}"
- 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}}"
state: "present"
with_items:
- "{{transportzones}}"
- 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 profile
nsxt_transport_node_profiles:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: False
resource_type: TransportNodeProfile
display_name: "{{item.display_name}}"
description: NSX configured Test Transport Node Profile
host_switch_spec:
resource_type: StandardHostSwitchSpec
host_switches: "{{item.host_switches}}"
transport_zone_endpoints: "{{item.transport_zone_endpoints}}"
state: present
with_items:
- "{{transport_node_profiles}}"
- name: Attach Transport node profile to cluster
nsxt_transport_node_collections:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: False
display_name: "TNC1"
resource_type: "TransportNodeCollection"
description: "Transport Node Collections 1"
compute_manager_name: "VC1"
cluster_name: "os-compute-cluster-1"
transport_node_profile_name: "TNP1"
state: present