-
Notifications
You must be signed in to change notification settings - Fork 0
/
dom.yml
63 lines (63 loc) · 2.11 KB
/
dom.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
---
- hosts: apic
tasks:
- set_fact:
#phie: '{{ phie | default([]) + [[ item.key, item.value | list ]] }}'
epgs: '{{ epgs | default([]) + item.value | map("extract", item.value) | list }}'
with_dict: '{{ aps }}'
#- set_fact:
# pflt: '{{ pflt | default([]) + ([ item.0 ] * item.1 | length) | zip(item.1) | list }}'
# with_list: '{{ phie }}'
#- debug: var=pflt
# TBD: make pool/domain tasks included/imported to loop over them with items from here.
- set_fact: items={{ epgs | map(attribute="dom") | unique | map("extract", doms) | list }}
- aci_encap_pool: &ep
<<: &st-ol
state: '{{ intent }}'
output_level: '{{ output_level }}'
pool: &pool
'{{ item.pool }}'
pool_allocation_mode: &pool_mode
'{{ item.pool_mode | default("static") }}'
pool_type: '{{ item.encap_mode | default("vlan") }}'
args: '{{ aci_vars }}'
with_list: '{{ items }}'
ignore_errors: '{{ intent == "absent" }}'
- aci_encap_pool_range:
<<: *ep
range_name: '{{ item.encap | default(1) }}'
range_start: &enc
'{{ item.encap | default(1) }}'
range_end: *enc
args: '{{ aci_vars }}'
with_list: '{{ items }}'
when: intent != "absent"
- aci_domain: &dom
<<: *st-ol
domain: &dom_name
'{{ item.dom }}'
domain_type: &dom_type
'{{ item.dom_type | default("phys") }}'
args: '{{ aci_vars }}'
with_list: '{{ items }}'
ignore_errors: '{{ intent == "absent" }}'
- aci_domain_to_vlan_pool:
<<: *dom
pool: *pool
pool_allocation_mode: *pool_mode
args: '{{ aci_vars }}'
with_list: '{{ items }}'
when: intent != "absent"
- aci_aep: &aep
<<: *st-ol
aep: '{{ item.aep }}'
args: '{{ aci_vars }}'
with_list: '{{ items }}'
ignore_errors: '{{ intent == "absent" }}'
- aci_aep_to_domain:
<<: *aep
domain: *dom_name
domain_type: *dom_type
args: '{{ aci_vars }}'
with_list: '{{ items }}'
when: intent != "absent"