Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ansible class query for ACI

This repository contains an Ansible playbook you can use to query the managed object classes of an Cisco ACI controller.

Prerequisites

Before running the playbook, ensure you have the following installed:

  • Ansible
  • Access to the target APIC controller with appropriate credentials

Directory Structure

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

Getting Started

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-classquery

Configure Inventory

In the inventory/hosts file, define your target hosts (servers) for deployment:

[apic]
apic.example.com

Run the Playbook

To execute the playbook, run the following command:
ansible-playbook Examples

This will query the managed objects from the target controller in your inventory.

Examples

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"

License

This project is licensed under the GNUv3 License - see the LICENSE file for details.

About

Cisco ACI moquery like searches as an ansible module

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages