-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate-static-with.yml
More file actions
72 lines (65 loc) · 2.55 KB
/
create-static-with.yml
File metadata and controls
72 lines (65 loc) · 2.55 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
---
- name: Configure Static Ports
hosts: all
gather_facts: no
connection: local
vars:
aci_login: &aci_login
hostname: '{{ ansible_host }}'
username: '{{ lookup("env", "ANSIBLE_NET_USERNAME") | default(ansible_user, true) }}'
password: '{{ lookup("env", "ANSIBLE_NET_PASSWORD") | default(ansible_password, true) }}'
validate_certs: no
tasks:
- name: Create a Static Port Interface Policy Group
aci_interface_policy_leaf_policy_group:
<<: *aci_login
lag_type: leaf
description: "{{ lap_desc }}"
policy_group: LAP-{{ lap_name | upper }}
storm_control_interface_policy: SC-0.1
aep_name: "{{ aepname_reset }}"
lldp_policy: LLDP-{{ lldp | upper }}
cdp_policy: CDP-{{ cdp | upper }}
state: present
vars:
aepname_reset: '{{ "AEP-" + hardware_env if hardware_env is defined and hardware_env | length > 0 else aepname | default("AEP-IAI", true) | upper }}'
- name: Add a new leaf_interface_profile
aci_interface_policy_leaf_profile:
<<: *aci_login
leaf_interface_profile: LIP-{{ leaf }}
state: present
- name: Associate an Interface Access Port Selector to an Interface Policy Leaf Profile with a Policy Group
aci_access_port_to_interface_policy_leaf_profile:
<<: *aci_login
leaf_interface_profile: LIP-{{ leaf }}
access_port_selector: "APS-{{ hostname | upper }}"
interface_type: switch_port
policy_group: LAP-{{ lap_name|upper }}
state: present
- name: Associate an access port block (single port) to an interface selector
aci_access_port_block_to_access_port:
<<: *aci_login
leaf_interface_profile: LIP-{{ leaf }}
access_port_selector: "APS-{{ hostname | upper }}"
leaf_port_blk: "{{ hostname | upper }}_{{ port }}"
from_port: "{{ port }}"
to_port: "{{ port }}"
leaf_port_blk_description: "{{ hostname | upper }}"
state: present
- name: Deploy Static Path binding for given EPG
aci_static_binding_to_epg:
<<: *aci_login
tenant_name: "{{ tenant_name }}"
app_profile_name: AP-{{ vrf_rot | upper }}
epg_name: EPG-EXT-{{ '%04d' | format(vlan | int) }}-{{ vlan_name | upper }}
vlan_id: "{{ '%04d' | format(vlan | int) }}"
primary_vlan_id: "{{ pvlan_id | default(omit, true) }}"
deploy_immediacy: immediate
interface_mode: "{{ if_mode }}"
interface_type: switch_port
pod_id: 1
leafs: "{{ leaf }}"
interface: "1/{{ port }}"
description: "{{ hostname }}"
state: present
when: if_mode is defined