forked from derwarre/aci-ansible
-
Notifications
You must be signed in to change notification settings - Fork 1
/
aci-demo.yml
145 lines (131 loc) · 4.15 KB
/
aci-demo.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
---
#Demo playbook
- name: Configuring Tenant
hosts: apic
connection: local
gather_facts: no
vars:
action: post
tenant_name: production
vrf_name: vrf1
bd1:
name: bd_vlan_100
ip: 192.168.100.4
mask: 24
bd2:
name: bd_vlan_200
ip: 192.168.200.4
mask: 24
app_profile_name: app1
epg_name1: epg_vlan_100
epg_name2: epg_vlan_200
vmm_domain: prod
protocol: http
tasks:
- name: Creating Tenant
aci_tenant:
action: "{{ action }}"
tenant_name: "{{ tenant_name }}"
descr: 'tenant'
host: "{{ host }}"
username: "{{ user }}"
password: "{{ pass }}"
protocol: "{{ protocol }}"
- name: Creating Vrf
aci_context:
action: "{{ action }}"
tenant_name: "{{ tenant_name }}"
vrf_name: "{{ vrf_name }}"
host: "{{ host }}"
username: "{{ user }}"
password: "{{ pass }}"
protocol: "{{ protocol }}"
- name: Creating BD
aci_bridge_domain:
action: "{{ action }}"
tenant_name: "{{ tenant_name }}"
vrf_name: "{{ vrf_name }}"
bd_name: "{{ item.name }}"
gateway_ip: "{{ item.ip }}"
subnet_mask: "{{ item.mask }}"
host: "{{ host }}"
username: "{{ user }}"
password: "{{ pass }}"
protocol: "{{ protocol }}"
with_items:
- "{{ bd1 }}"
- "{{ bd2 }}"
- name: Associating L3 Out with BD
aci_l3Out:
action: "{{ action }}"
tenant_name: "{{ tenant_name }}"
bd_name: "{{ bd1.name }}"
l3_out: default
host: "{{ host }}"
username: "{{ user }}"
password: "{{ pass }}"
protocol: "{{ protocol }}"
- name: Associationg DHCP Relay Labels
aci_dhcp_association:
action: "{{ action }}"
tenant_name: "{{ tenant_name }}"
bd_name: "{{ bd2.name }}"
dhcp_name: default
dhcp_scope: infra
host: "{{ host }}"
username: "{{ user }}"
password: "{{ pass }}"
protocol: "{{ protocol }}"
- name: Create ANP
aci_anp:
action: "{{ action }}"
app_profile_name: "{{ app_profile_name }}"
tenant_name: "{{ tenant_name }}"
host: "{{ host }}"
username: "{{ user }}"
password: "{{ pass }}"
protocol: "{{ protocol }}"
- name: Create EPG_100
aci_epg:
action: "{{ action }}"
app_profile_name: "{{ app_profile_name }}"
tenant_name: "{{ tenant_name }}"
epg_name: "{{ epg_name1 }}"
bd_name: "{{ bd1.name }}"
contract_name_provider: default
contract_name_consumer: default
contract_type: both
host: "{{ host }}"
username: "{{ user }}"
password: "{{ pass }}"
protocol: "{{ protocol }}"
- name: Create EPG_200
aci_epg:
action: "{{ action }}"
app_profile_name: "{{ app_profile_name }}"
tenant_name: "{{ tenant_name }}"
epg_name: "{{ epg_name2 }}"
bd_name: "{{ bd2.name }}"
contract_name_provider: default
contract_name_consumer: default
contract_type: both
host: "{{ host }}"
username: "{{ user }}"
password: "{{ pass }}"
protocol: "{{ protocol }}"
- name: Deploying EPG_100
aci_epg_domain_binding:
action: "{{ action }}"
app_profile_name: "{{ app_profile_name }}"
tenant_name: "{{ tenant_name }}"
epg_name: "{{ item }}"
domain: vmm
domain_profile: "{{ vmm_domain }}"
deploy_immediacy: immediate
host: "{{ host }}"
username: "{{ user }}"
password: "{{ pass }}"
protocol: "{{ protocol }}"
with_items:
- "{{ epg_name1 }}"
- "{{ epg_name2 }}"