-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path4.vrf.yml
55 lines (51 loc) · 2.46 KB
/
4.vrf.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
---
- ansible.builtin.import_playbook: update.yml
- name : VRFs
gather_facts: false
hosts: all
vars:
- aci_login: &mso_login
hostname: "{{ ansible_host }}"
username: "{{ ansible_user }}"
password: "{{ ansible_password }}"
validate_certs: "{{ validate_certs }}"
tasks:
- name: Add a new VRF
cisco.mso.mso_schema_template_vrf_dcnm:
<<: *mso_login
schema: "{{ item.schema_name }}"
template: "{{ item.template_name }}"
vrf: "{{ item.name }}"
state: "{{ item.status if item.status is defined else omit }}"
vrf_id: "{{ item.vrf_id | int if item.vrf_id is defined and item.vrf_id != '' else omit }}"
vrf_profile : "{{ item.vrf_profile if item.vrf_profile is defined and item.vrf_profile != '' else omit }}"
vrf_extension_profile: "{{ item.vrf_extension_profile if item.vrf_extension_profile is defined and item.vrf_extension_profile != '' else omit }}"
loopback_routing_tag: "{{ item.loopback_routing_tag | int if item.loopback_routing_tag is defined and item.loopback_routing_tag != '' else omit }}"
redistribute_direct_route_map: "{{ item.redistribute_direct_route_map if item.redistribute_direct_route_map is defined and item.redistribute_direct_route_map != '' else omit }}"
disable_rt_auto_generate: "{{ item.disable_rt_auto_generate if item.disable_rt_auto_generate is defined and item.disable_rt_auto_generate != '' else omit }}"
delegate_to: localhost
loop: "{{ vrf }}"
when: vrf is defined
- name: Add a new site VRF
cisco.mso.mso_schema_site_vrf:
<<: *mso_login
schema: "{{ item.vrf_schema_name }}"
template: "{{ item.vrf_template_name }}"
vrf: "{{ item.vrf_name }}"
site: "{{ item.site }}"
state: "{{ item.status if item.status is defined else omit }}"
delegate_to: localhost
loop: "{{ vrf_site_association }}"
when: vrf_site_association is defined
- name: Associate Switch to Vrf
cisco.mso.mso_schema_site_vrf_switch_dcnm:
<<: *mso_login
schema: "{{ item.vrf_schema_name }}"
template: "{{ item.vrf_template_name }}"
vrf: "{{ item.vrf_name }}"
site: "{{ item.site }}"
switch_serial_number: "{{ item.switch_serial_number }}"
state: "{{ item.status if item.status is defined else omit }}"
delegate_to: localhost
loop: "{{ vrf_site_switch_association }}"
when: vrf_site_switch_association is defined