This repository contains an Ansible playbook you can use to query the managed object classes of an Cisco ACI controller.
Before running the playbook, ensure you have the following installed:
- Ansible
- Access to the target APIC controller with appropriate credentials
ansible-playbook-aci-classquery/
├── playbook.yml # main playbook
├── inventory/ # inventory directory
│ └── hosts # inventory file
├── library/ # module directory
│ └── aci_classquery.py # ansible module
├── README.md # this file
└── requirements.txt # requirements file
To use the playbook, clone this repository to your local machine:
git clone https://github.com/bechtle-bms/ansible-playbook-aci-classquery.git
cd ansible-playbook-aci-classqueryIn the inventory/hosts file, define your target hosts (servers) for deployment:
[apic]
apic.example.com
To execute the playbook, run the following command:
ansible-playbook Examples
This will query the managed objects from the target controller in your inventory.
Query tenant
playbook.yml -i inventory/hosts -e "@./auth.json" -e "aci_class=fvTenant"Query tenant with target filter
playbook.yml -i inventory/hosts -e "@./auth.json" -e "aci_class=fvTenant" -e "target_filter=name" -e "target_filter_query=common"Query tenant with target filter and child class
playbook.yml -i inventory/hosts -e "@./auth.json" -e "aci_class=fvTenant" -e "target_filter=name" -e "target_filter_query=common" -e "child_classes=fvAp"Query tenant with target filter and multiple child classes
playbook.yml -i inventory/hosts -e "@./auth.json" -e "aci_class=fvTenant" -e "target_filter=name" -e "target_filter_query=common" -e "child_classes=fvAp,fvBD"This project is licensed under the GNUv3 License - see the LICENSE file for details.