-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaci-fabric-ap-interface.yml
More file actions
90 lines (83 loc) · 3.08 KB
/
aci-fabric-ap-interface.yml
File metadata and controls
90 lines (83 loc) · 3.08 KB
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
---
- name: Adding ACI fabric access policies for interfaces using a CSV file
hosts: sandboxapicdc.cisco.com
gather_facts: no
vars_files:
- ./vars/creds.yml
tasks:
- name: Gather facts from CSV file
read_csv:
path: aci-config/fabric-ap-int-policy.csv
#register in the config list:
register: config
delegate_to: localhost
- name: Create a Virtual Port Channel (VPC) or Port Channel Interface Policy Group
cisco.aci.aci_interface_policy_leaf_policy_group:
host: "{{ apic }}"
username: "{{ aci_username }}"
password: "{{ aci_password }}"
validate_certs: no
lag_type: "{{ index.linktype }}"
policy_group: "{{ index.intpolicy }}"
aep: "{{ index.aep }}"
link_level_policy: "{{ index.speedpolicy }}"
cdp_policy: "{{ index.cdppolicy }}"
lldp_policy: "{{ index.lldppolicy }}"
port_channel_policy: "{{ index.pcpolicy }}"
state: "{{ index.state }}"
delegate_to: localhost
when: ("{{ index.linktype }}" != "leaf")
loop: "{{ config.list }}"
loop_control:
loop_var: index
- name: Create a Leaf Access Port Policy Group
cisco.aci.aci_interface_policy_leaf_policy_group:
host: "{{ apic }}"
username: "{{ aci_username }}"
password: "{{ aci_password }}"
validate_certs: no
lag_type: "{{ index.linktype }}"
policy_group: "{{ index.intpolicy }}"
aep: "{{ index.aep }}"
link_level_policy: "{{ index.speedpolicy }}"
cdp_policy: "{{ index.cdppolicy }}"
lldp_policy: "{{ index.lldppolicy }}"
state: "{{ index.state }}"
delegate_to: localhost
when: ("{{ index.linktype }}" == "leaf")
loop: "{{ config.list }}"
loop_control:
loop_var: index
- debug:
msg: "{{ index.intpolicy }} - {{ index.linktype }} - {{ index.state }}"
loop: "{{ config.list }}"
loop_control:
loop_var: index
- name: Gather facts from CSV file
read_csv:
path: aci-config/fabric-ap-int-block.csv
#register in the config list:
register: config
delegate_to: localhost
- name: Associate an Interface Access Port Selector to an Interface Policy Leaf Profile with a Policy Group
cisco.aci.aci_access_port_to_interface_policy_leaf_profile:
host: "{{ apic }}"
username: "{{ aci_username }}"
password: "{{ aci_password }}"
validate_certs: no
interface_profile: "{{ index.intleafprf }}"
access_port_selector: "{{ index.intname }}"
port_blk: "{{ index.intname }}"
from_port: "{{ index.intfrom }}"
to_port: "{{ index.intto }}"
policy_group: "{{ index.intpolicy }}"
state: "{{ index.state }}"
delegate_to: localhost
loop: "{{ config.list }}"
loop_control:
loop_var: index
- debug:
msg: "{{ index.intleafprf }} - {{ index.intname }} - {{ index.intfrom }} - {{ index.intto }} - {{ index.intpolicy }} - {{ index.state }}"
loop: "{{ config.list }}"
loop_control:
loop_var: index