-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathintent.yml
371 lines (371 loc) · 13.7 KB
/
intent.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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
tenants:
### Logical Tenants
- name: Ansible-Demo-Internal
description: Demo tenant created by Ansible IaC
state: present
applications:
### Application Configuration
- name: OpenCart
description: Example 2-Tier OpenCart Demo Application
state: present
accessgroups:
- name: App
description: OpenCart Application VMs
state: present
bridgedomain: AN-Production
contracts:
provided:
- name: OC-Client-to-App
state: present
- name: Admin-to-Servers
state: present
consumed:
- name: OC-App-to-DB
state: present
- name: Internet-via-Proxy
state: present
- name: Internal-DNS
state: present
domains:
### Access Domain(s)
- name: DVS-VMM # Dynamic VMware vSphere Domain
type: vmm # l2dom, phys, vmm
provider: vmware
state: present
# - name: BM-SERVERS # Bare Metal Servers
# type: physical
# ports:
### Access Port(s)
# - type: switch_port # switch_port, port_channel, vpc
# state: present
# switch: 101 # Needs list [..] for vpc port types
# interface: 1/30
# mode: trunk # 802.1p, access, native, regular, trunk, untagged
# vlan: 400
- name: DB
description: OpenCart Database VMs
state: present
bridgedomain: AN-Production
contracts:
provided:
- name: OC-App-to-DB
state: present
- name: Admin-to-Servers
state: present
consumed:
- name: Internet-via-Proxy
state: present
- name: Internal-DNS
state: present
domains:
### Access Domain(s)
- name: DVS-VMM # Dynamic VMware vSphere Domain
type: vmm # l2dom, phys, vmm
provider: vmware
state: present
networking:
### Networking Configuration
bridgedomains:
### Layer 2 Segments
- name: AN-Production
description: Production Servers
state: present
vrf: Internal
l3outs:
- name: core
state: present
subnets:
### Distributed Anycast Gateway
- gatewayip: {{ADD YOUR GATEWAY IP HERE}}
masklength: 29
state: present
primary: true
scope: # "private", "public", "shared"
- public
# - name: AN-Development
# description: Development Servers
# state: present
# vrf: Internal
# l3outs:
# - name: core
# state: present
# subnets:
# ### Distributed Anycast Gateway
# - gatewayip: {{ADD YOUR GATEWAY IP HERE}}
# masklength: 29
# state: present
# primary: true
# scope: # "private" | "public", "shared" ## Needs to be private if not in actual use
# - private
vrfs:
### Layer 3 Segments
- name: Internal
description: Demo Internal VRF created by Ansible
state: present
l3outs:
- name: core
description: Routed OSPF uplink to core network
state: present
domain: LAB-N9348
protocol: bgp
node_profiles:
- name: Uplink-Node-Profile
description: Node profile for uplink to core
state: present
nodes:
- id: 101
router_id: 101.1.1.1
state: present
- id: 102
router_id: 102.1.1.1
state: present
interface_profiles:
- name: Uplink-Interface-Profile
# description: Interface profile for uplink to core
state: present
interfaces:
- type: ext-svi # "l3-port", "sub-interface", "ext-svi"
state: present
node_id: 102 # 101-102 for vPCs
vlan: 477
path: eth1/1 # ethX/X or name of PC/vPC interface policy group
address: {{ADD YOUR LOCAL SWITCH IP/MASK HERE}}
bgp_peers:
- address: {{ADD YOUR BGP NEIGBOUR HERE}}
asn: 65004
state: present
external_access_groups:
- name: Allow-BGP-Advertisement
description: External Route Control Network for BGP Allow-BGP-Advertisement
state: present
networks:
- network: {{ADD YOUR SERVER IP/MASK HERE}}
state: present
scope:
- export-rtctrl
- network: {{ADD YOUR SERVER IP/MASK HERE}}
state: present
scope:
- export-rtctrl
- name: Lab-Proxy
description: Lab Proxy Server
state: present
networks:
- network: {{ADD YOUR SERVER IP/MASK HERE}}
state: absent
scope: # "export-rtctrl", "import-rtctrl", "import-security", "shared-rtctrl", "shared-security",
- import-security
- network: {{ADD YOUR SERVER IP/MASK HERE}}
state: absent
scope: # "export-rtctrl", "import-rtctrl", "import-security", "shared-rtctrl", "shared-security",
- import-security
- network: {{ADD YOUR SERVER IP/MASK HERE}}
state: absent
scope: # "export-rtctrl", "import-rtctrl", "import-security", "shared-rtctrl", "shared-security",
- import-security
- network: {{ADD YOUR SERVER IP/MASK HERE}}
state: absent
scope: # "export-rtctrl", "import-rtctrl", "import-security", "shared-rtctrl", "shared-security",
- import-security
- network: {{ADD YOUR SERVER IP/MASK HERE}}
state: present
scope: # "export-rtctrl", "import-rtctrl", "import-security", "shared-rtctrl", "shared-security",
- import-security
contracts:
provided:
- name: Internet-via-Proxy
state: present
- name: Internal-DNS-Servers
description: Internal DNS Servers
state: present
networks:
- network: {{ADD YOUR SERVER IP/MASK HERE}}
state: present
scope: # "export-rtctrl", "import-rtctrl", "import-security", "shared-rtctrl", "shared-security",
- import-security
- network: {{ADD YOUR SERVER IP/MASK HERE}}
state: present
scope: # "export-rtctrl", "import-rtctrl", "import-security", "shared-rtctrl", "shared-security",
- import-security
- network: {{ADD YOUR SERVER IP/MASK HERE}}
state: present
scope: # "export-rtctrl", "import-rtctrl", "import-security", "shared-rtctrl", "shared-security",
- import-security
contracts:
provided:
- name: Internal-DNS
state: present
- name: RFC1918
description: External RFC1918 Addressed Clients
state: present
networks:
- network: 10.0.0.0/8
state: present
scope: # "export-rtctrl", "import-rtctrl", "import-security", "shared-rtctrl", "shared-security",
- import-security
- network: 172.16.0.0/12
state: present
scope: # "export-rtctrl", "import-rtctrl", "import-security", "shared-rtctrl", "shared-security",
- import-security
- network: 192.168.0.0/16
state: present
scope: # "export-rtctrl", "import-rtctrl", "import-security", "shared-rtctrl", "shared-security",
- import-security
contracts:
# provided:
# - name: Internet-via-Proxy
# state: absent
# - name: Internal-DNS
# state: absent
consumed:
- name: OC-Client-to-App
state: present
- name: Administrators
## Note: Must be built after RFC1918 as called as contract master
description: Internal server administrator group
state: present
networks:
- network: {{ADD YOUR SERVER IP/MASK HERE}}
state: present
scope: # "export-rtctrl", "import-rtctrl", "import-security", "shared-rtctrl", "shared-security",
- import-security
contracts:
masters:
- name: RFC1918
l3out: core
state: present
consumed:
- name: Admin-to-Servers
state: present
security:
### L3-L4 Security Configuration
filters:
### Protocol Groups
- name: icmp
state: present
entries:
- name: icmp
state: present
ethtype: ip
protocol: icmp
- name: proxy
state: absent
entries:
- name: http-8080
state: present
ethtype: ip
protocol: tcp
dest_port:
from: 8080
to: 8080
- name: dns
state: present
entries:
- name: dns-udp-53
state: present
ethtype: ip
protocol: udp
dest_port:
from: 53
to: 53
- name: web
state: present
entries:
- name: http-80
state: present
ethtype: ip
protocol: tcp
dest_port:
from: 80
to: 80
- name: https-443
state: present
ethtype: ip
protocol: tcp
dest_port:
from: 443
to: 443
- name: mysql
state: present
entries:
- name: mysql-3306
state: present
ethtype: ip
protocol: tcp
dest_port:
from: 3306
to: 3306
- name: ssh
state: present
entries:
- name: ssh-22
state: present
ethtype: ip
protocol: tcp
dest_port:
from: 22
to: 22
contracts:
standard:
### Access Control Lists (ACLs)
- name: OC-Client-to-App
description: Allow clients to reach OpenCart web interface
state: present
subjects:
- name: default
state: present
filters:
- name: web
state: present
- name: icmp
state: present
- name: OC-App-to-DB
description: Allow OpenCart App server(s) to reach Database server(s)
state: present
subjects:
- name: default
state: present
filters:
- name: mysql
state: present
- name: icmp
state: present
- name: Internet-via-Proxy
description: Allow outbound internet access via proxy
state: present
subjects:
- name: default
state: present
filters:
- name: proxy
state: absent
- name: web
state: present
- name: icmp
state: present
- name: Internal-DNS
description: Allow DNS service access
state: present
subjects:
- name: default
state: present
filters:
- name: dns
state: present
- name: icmp
state: present
- name: Admin-to-Servers
description: Allow SSH access to servers
state: present
subjects:
- name: default
state: present
filters:
- name: ssh
state: present
# - name: Ansible-Demo-DMZ
# description: Demo tenant created by Ansible IaC added
# state: present
# # applications:
# # networking:
# # security: