forked from vmware/ansible-for-nsxt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_configure_transport_node.yml
67 lines (63 loc) · 2.01 KB
/
test_configure_transport_node.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
# 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_tn.yml
tasks:
- 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
nsxt_transport_nodes:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
validate_certs: False
display_name: "{{item.display_name}}"
host_switch_spec:
resource_type: StandardHostSwitchSpec
host_switches: "{{item.host_switches}}"
transport_zone_endpoints: "{{item.transport_zone_endpoints}}"
node_deployment_info: "{{item.node_deployment_info}}"
state: present
with_items:
- "{{transport_nodes}}"