hope someone can assist here as i seem to be going in circles & not getting anywhere fast.
I am trying to map ACI VRFs to their associated parent tenant.
The modules I am using with some basic Jinja2 filters allow me to map tenant–>vrf but I now need to swap the order, to map vrf–>tenant
The idea is that once I have this mapping, a requester will on;ly need to provide the VRF id & I will map it to the correct tenant.
Here is what i have created so far with the output I have generated.
ansible_facts:
my_dict:
ave-ctrl: infra
default: common
inb: mgmt
oob: mgmt
ansible_loop_var: item
changed: false
failed: false
item: common/default
ansible_facts:
my_dict:
ave-ctrl: infra
default: common
inb: mgmt
oob: mgmt
overlay-1: infra
ansible_loop_var: item
changed: false
failed: false
item: infra/overlay-1
ansible_facts:
my_dict:
ave-ctrl: infra
copy: common
default: common
inb: mgmt
oob: mgmt
overlay-1: infra
ansible_loop_var: item
changed: false
failed: false
item: common/copy
ansible_facts:
my_dict:
ave-ctrl: infra
copy: common
default: common
inb: mgmt
oob: mgmt
overlay-1: infra
v11-aci: tn-shared
vrf_DEFAULT: tn_NBK101
ansible_loop_var: item
changed: false
failed: false
item: tn_NBK101/vrf_DEFAULT
ansible_facts:
my_dict:
ave-ctrl: infra
copy: common
default: common
inb: mgmt
oob: mgmt
overlay-1: infra
v13-aci: tn-prod-trusted
vrf_DEFAULT: tn_NBK101
ansible_loop_var: item
changed: false
failed: false
item: tn-prod-trusted/v13-aci
ansible_facts:
my_dict:
ave-ctrl: infra
copy: common
default: common
inb: mgmt
oob: mgmt
overlay-1: infra
v13-aci: tn-prod-trusted
vrf_DEFAULT: tn_NBK101
vrf_UCSD: tn_UCSD
ansible_loop_var: item
changed: false
failed: false
item: tn_UCSD/vrf_UCSD
…
`
How do I manage to read just the last my_dict output & use that for my next task in another role?
I can get the output format correct to display just what I am looking for in my variable request.