I'm trying to get a routing table from a Cisco ACI. I'm getting duplicate routes. Is there a way to sort them out?
example:
"10.127.32.70/32",
"10.127.32.70/32",
"10.127.32.70/32",
"10.127.32.70/32",
"10.127.32.70/32",
"10.127.32.70/32"
after duplicate filter:
"10.127.32.70/32"
- name: Get Route table (vars tenant and VRF)
aci_rest:
<<: *aci_login
path: api/node/class/uribv4Nexthop.json?query-target-filter=wcard(uribv4Nexthop.dn,"sys/uribv4/dom\-C_Lab:LAB_VRF/db\-rt")
method: "get"
register: response
# - debug:
# var: response
- name: Create a subnet list item
set_fact:
array_content: "{{ item['uribv4Nexthop']['attributes']['addr'] }}"
with_items:
- "{{ response['imdata'] }}"
register: array_of_contents
- name: Make a list with all the subnet items
set_fact:
data_struc: "{{ array_of_contents.results | map(attribute='ansible_facts.array_content') | list }}"
- debug:
var: data_struc