cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
423
Views
0
Helpful
1
Replies

Ansible - writing remove EPG playbook and looking for appropriate chec

ThePVD
Level 1
Level 1

We're currently working in a large enterprise environment and have written ansible code as part of an end-to-end provisioning workflow for ACI connected VMWare infrastructure.

Now, we are working on creating a decomissioning flow.  While removing an EPG looks trivial with the aci_epg module, we want to do some checking prior to removal.  Specifically, want to ensure that that the corresponding port group has no virtual network adapters attached.

Is anyone familiar with a way to gather this information via ACI Ansible modules?  The info is clearly discovered by ACI and is viewable in UX, but we have been unsuccessful in retrieving information for any given portgroup with ansible.

Appreciate any help or guidance.

1 Accepted Solution

Accepted Solutions

ThePVD
Level 1
Level 1

Following up - we were able to effectively solve this problem by using the following query and counting the objects returned; one per attached VM / vmnic.

/api/node/mo/uni/tn-<tenant>/ap-<ap>/epg-<apepg>.json?query-target=children&target-subtree-class=fvCEp

View solution in original post

1 Reply 1

ThePVD
Level 1
Level 1

Following up - we were able to effectively solve this problem by using the following query and counting the objects returned; one per attached VM / vmnic.

/api/node/mo/uni/tn-<tenant>/ap-<ap>/epg-<apepg>.json?query-target=children&target-subtree-class=fvCEp

Review Cisco Networking for a $25 gift card

Save 25% on Day-2 Operations Add-On License