-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaci-csv-bridge-domains.yml
70 lines (65 loc) · 2.1 KB
/
aci-csv-bridge-domains.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
---
- name: "Configuring ACI bridge domains using a CSV file"
hosts: sandboxapicdc.cisco.com
gather_facts: no
vars_files:
- .aci-vars.yml
tasks:
- name: "Gather facts from CSV file"
read_csv:
path: aci-config.csv
#register in the config list:
register: aci-config
delegate_to: localhost
- name: "Configure new bridge domain on ACI"
cisco.aci.aci_bd:
host: "{{ apic }}"
username: "{{ aci_username }}"
password: "{{ aci_password }}"
validate_certs: no
tenant: "{{ index.tenant }}"
vrf: "{{ index.vrf }}"
bd: "{{ index.bd }}"
enable_routing: "{{ index.enable_routing }}"
arp_flooding: "{{ index.arp_flooding }}"
limit_ip_learn: "{{ index.limit_ip_learn }}"
state: "{{ index.state }}"
delegate_to: localhost
loop: "{{ aci-config.list }}"
loop_control:
loop_var: index
- name: "Add subnet to new bridge domain"
cisco.aci.aci_bd_subnet:
host: "{{ apic }}"
username: "{{ aci_username }}"
password: "{{ aci_password }}"
validate_certs: no
tenant: "{{ index.tenant }}"
bd: "{{ index.bd }}"
gateway: "{{ index.gateway }}"
mask: "{{ index.mask }}"
scope: "{{ index.scope }}"
state: "{{ index.state }}"
delegate_to: localhost
loop: "{{ aci-config.list }}"
loop_control:
loop_var: index
- name: "Add l3out to new bridge domain"
cisco.aci.aci_bd_to_l3out:
host: "{{ apic }}"
username: "{{ aci_username }}"
password: "{{ aci_password }}"
validate_certs: no
tenant: "{{ index.tenant }}"
bd: "{{ index.bd }}"
l3out: "{{ index.l3out }}"
state: "{{ index.state }}"
delegate_to: localhost
loop: "{{ aci-config.list }}"
loop_control:
loop_var: index
- debug:
msg: "{{ index.tenant }} - {{ index.vrf }} - {{ index.bd }} - {{ index.gateway }} - {{ index.mask }} - {{ index.scope }}"
loop: "{{ aci-config.list }}"
loop_control:
loop_var: index