04-18-2022 05:54 AM
Hoping to get help on this. I've got the aci module for interface descriptions from the github
- name: Set Interface Description cisco.aci.aci_interface_description: host: "{{ inventory_hostname }}" username: "{{ username }}" password: "{{ password }}" validate_certs: no pod_id: 1 node_id: 105 node_type: leaf interface: 1/49 description: foobar state: present delegate_to: localhost
The issue is, I want to be able to do this for a range of interfaces, or even multiple, non-consecutive, interfaces. I don't see an option in the module for this. Wondering if maybe anyone has made a loop using dict2items (I haven't made one work properly yet) with this module, or even the rest module.
I'm aware that this can kind of be done with the aci_access_port_block_to_access_port module. However, this doesn't quite work if an interface in the block already has some other description. It seems ACI prioritizes individually set descriptions over a port block description.
05-17-2022 10:38 PM - edited 05-17-2022 10:49 PM
HI, John
Here's the API Inspector information which recorded during interface description added.
If you want to add for multple times, you'll need to write a task for each of it when adding it for the first time.
-Creates it under the access policies
method: POST
payload{"infraPortBlk":{"attributes":{"dn":"uni/infra/accportprof-101/hports-N5596-A-p48-typ-range/portblk-block2","descr":"TEST"},"children":[]}}
-Creates it under the inventory tab
method: POST
url: https://xx.xx.xx.xx/api/node/mo/uni/infra/hpaths-101_eth1_48.json
payload"{\"infraHPathS\":{\"attributes\":{\"descr\":\"ABCD123\",\"status\":\"created,modified\"}}}"
-note if you use the string TEST it wont show in the payload of the API call as seen below.
url: https://XX.XX.XX.XX/api/node/mo/uni/infra/hpaths-101_eth1_48.json
payload"{\"infraHPathS\":{\"attributes\":{\"status\":\"created,modified\"}}}"
Hope this will help. If you still got ansible adding description failure, you could also raise a TAC case for further investigation.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide