forked from soumukhe/MSO-Ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1ha.AddL3OutSite1Only.yaml
112 lines (97 loc) · 3.55 KB
/
1ha.AddL3OutSite1Only.yaml
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
---
- name: add schema to Tenant
hosts: mso
connection: local
gather_facts: false
vars_files:
- external_vars.yml
tasks:
- name: Add a new schema
cisco.mso.mso_schema_template:
host: "{{ host }}"
username: "{{ username }}"
password: "{{ password }}"
tenant: "{{ tenant }}"
schema: "{{ schema }}"
template: "SM-Site1-Only"
validate_certs: "no"
use_proxy: false
state: present
delegate_to: localhost
- name: Assocoate schema with site
cisco.mso.mso_schema_site:
host: "{{ host }}"
username: "{{ username }}"
password: "{{ password }}"
schema: "{{ schema }}"
site: "DMZ-RCDN-Site1"
validate_certs: "no"
use_proxy: false
template: "SM-Site1-Only"
state: present
delegate_to: localhost
- name: Add a new L3out
cisco.mso.mso_schema_template_l3out:
host: "{{ host }}"
username: "{{ username }}"
password: "{{ password }}"
validate_certs: "no"
use_proxy: false
schema: "{{ schema }}"
template: "SM-Site1-Only" # this is the template where the L3Out will be defined
vrf:
name: "sm-VRF1-ansible"
schema: "{{ schema }}"
template: "SM-Template1-ansible" # this is the template where the vrf is
l3out: "Site1-L3Out"
state: present
delegate_to: localhost
- name: Add a new external EPG
cisco.mso.mso_schema_template_external_epg:
host: "{{ host }}"
username: "{{ username }}"
password: "{{ password }}"
validate_certs: "no"
use_proxy: false
schema: "{{ schema }}"
template: "SM-Site1-Only" # this is the template where the L3Out will be defined
vrf:
name: "sm-VRF1-ansible"
schema: "{{ schema }}"
template: "SM-Template1-ansible" # this is the template where the vrf is
l3out:
name: "Site1-L3Out"
schema: "{{ schema }}"
template: "SM-Site1-Only" # this is the template where the L3Out is
external_epg: extEPG1
state: present
delegate_to: localhost
- name: Add a new subnet to an External EPG
cisco.mso.mso_schema_template_external_epg_subnet:
host: "{{ host }}"
username: "{{ username }}"
password: "{{ password }}"
validate_certs: "no"
use_proxy: false
schema: "{{ schema }}"
template: "SM-Site1-Only" # this is the template where the L3Out has been defined
external_epg: extEPG1
subnet: 10.0.0.0/24
scope: import-security # this equates to "external subnets for the external epg"
state: present
delegate_to: localhost
- name: deploy new template for L3Out
cisco.mso.mso_schema_template_deploy:
host: "{{ host }}"
username: "{{ username }}"
password: "{{ password }}"
validate_certs: "no"
use_proxy: false
schema: "{{ schema }}"
template: "SM-Site1-Only"
state: deploy
delegate_to: localhost
# usage: ansible-playbook --ask-vault-pass 1h.AddL3OutSite1Only.yaml -i hosts -vvv
# usage: ansible-playbook --vault-id vaultPass 1h.AddL3OutSite1Only.yaml -i hosts -vvv
# mso_schema – Manage schemas: https://docs.ansible.com/ansible/latest/modules/mso_schema_module.html#mso-schema-module
# mso_schema_site – Manage sites in schemas: https://docs.ansible.com/ansible/latest/modules/mso_schema_site_module.html#mso-schema-site-module