-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmso.yml
252 lines (227 loc) · 5.49 KB
/
mso.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
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
---
# MSO Lab Playbook
- name: Configuring a Schema on MSO
hosts: mso
connection: local
gather_facts: no
vars:
tenant: Spectrum-Ansible
schema: Spectrum-2
template: Template 1
vrf: VRF1
bd: BD1
ap: ANP1
epg1: Web
epg2: DB
l3out: L3Out
extEpg1: Internet
contract1: Web-to-DB
contract2: Web-to-Internet
filter1: Any
site: On-premises
mso_a: &mso_anchor
host: "{{ ansible_ssh_host }}"
username: "{{ mso_user }}"
password: "{{ mso_password }}"
template_a: &template_anchor
schema: "{{ schema }}"
template: "{{ template }}"
tasks:
- name: Add a tenant
delegate_to: localhost
mso_tenant:
<<: *mso_anchor
tenant: "{{ tenant }}"
display_name: "{{ tenant }}"
description: MSO Ansible Tenant
users: "{{ mso_user }}"
sites:
- "{{ site }}"
state: present
validate_certs: no
- name: Add Template to Schema
mso_schema_template:
<<: *mso_anchor
<<: *template_anchor
tenant: "{{ tenant }}"
state: present
validate_certs: no
delegate_to: localhost
- name: Add ANP
mso_schema_template_anp:
<<: *mso_anchor
<<: *template_anchor
anp: "{{ ap }}"
state: present
validate_certs: no
delegate_to: localhost
- name: Add VRF
mso_schema_template_vrf:
<<: *mso_anchor
<<: *template_anchor
vrf: "{{ vrf }}"
state: present
validate_certs: no
delegate_to: localhost
- name: Add BD
mso_schema_template_bd:
<<: *mso_anchor
<<: *template_anchor
bd: "{{ bd }}"
vrf:
name: "{{ vrf }}"
state: present
validate_certs: no
layer2_stretch: True
delegate_to: localhost
- name: Add Subnet to BD
mso_schema_template_bd_subnet:
<<: *mso_anchor
<<: *template_anchor
bd: "{{ bd }}"
ip: 10.101.0.254/24
state: present
scope: public
validate_certs: no
delegate_to: localhost
- name: Add EPG
mso_schema_template_anp_epg:
<<: *mso_anchor
<<: *template_anchor
anp: "{{ ap }}"
epg: "{{ epg1 }}"
bd:
name: "{{ bd }}"
state: present
validate_certs: no
delegate_to: localhost
- name: Add EPG
mso_schema_template_anp_epg:
<<: *mso_anchor
<<: *template_anchor
anp: "{{ ap }}"
epg: "{{ epg2 }}"
bd:
name: "{{ bd }}"
state: present
validate_certs: no
delegate_to: localhost
# - name: Add a new L3out
# mso_schema_template_l3out:
# <<: *mso_anchor
# <<: *template_anchor
# l3out: "{{ l3out }}"
# vrf:
# name: "{{ vrf }}"
# state: present
# validate_certs: no
# delegate_to: localhost
# - name: Add External EPG
# mso_schema_template_externalepg:
# <<: *mso_anchor
# <<: *template_anchor
# externalepg: "{{ extEpg1 }}"
# vrf:
# name: "{{ vrf }}"
# l3out:
# name: "{{ l3out }}"
# state: present
# validate_certs: no
# delegate_to: localhost
- name: Add Filter
mso_schema_template_filter_entry:
<<: *mso_anchor
<<: *template_anchor
filter: "{{ filter1 }}"
entry: "{{ filter1 }}"
ethertype: unspecified
state: present
validate_certs: no
delegate_to: localhost
- name: Add Contract
mso_schema_template_contract_filter:
<<: *mso_anchor
<<: *template_anchor
contract: "{{ contract1 }}"
contract_filter_type: both-way
filter: "{{ filter1 }}"
filter_type: both-way
state: present
validate_certs: no
delegate_to: localhost
- name: Add Contract to EPG
mso_schema_template_anp_epg_contract:
<<: *mso_anchor
<<: *template_anchor
anp: "{{ ap }}"
epg: "{{ epg1 }}"
contract:
name: "{{ contract1 }}"
type: consumer
state: present
validate_certs: no
delegate_to: localhost
- name: Add Contract to EPG
mso_schema_template_anp_epg_contract:
<<: *mso_anchor
<<: *template_anchor
anp: "{{ ap }}"
epg: "{{ epg2 }}"
contract:
name: "{{ contract1 }}"
type: provider
state: present
validate_certs: no
delegate_to: localhost
- name: Add Contract
mso_schema_template_contract_filter:
<<: *mso_anchor
<<: *template_anchor
contract: "{{ contract2 }}"
contract_filter_type: both-way
filter: "{{ filter1 }}"
filter_type: both-way
state: present
validate_certs: no
delegate_to: localhost
- name: Add Contract to EPG
mso_schema_template_anp_epg_contract:
<<: *mso_anchor
<<: *template_anchor
anp: "{{ ap }}"
epg: "{{ epg1 }}"
contract:
name: "{{ contract2 }}"
type: provider
state: present
validate_certs: no
delegate_to: localhost
# - name: Add a new site
# mso_site:
# <<: *mso_anchor
# site: "{{ site }}"
# apic_username: admin
# apic_password: MySuperSecretPassword
# apic_site_id: 1
# urls:
# - 173.36.219.190
# location:
# latitude: 47.25848009811691
# longitude: -123.91160220994475
# state: present
# delegate_to: localhost
- name: Add Site to Schema
mso_schema_site:
<<: *mso_anchor
<<: *template_anchor
site: "{{ site }}"
state: present
validate_certs: no
delegate_to: localhost
- name: Deploy a schema template
mso_schema_template_deploy:
<<: *mso_anchor
<<: *template_anchor
state: deploy
validate_certs: no
delegate_to: localhost