The cisco-aci-documenter is a collective of ansible tasks that will request the configuration, status, and policy mappings of an ACI fabric, and put it into an HTML report. Features and abilities include...
- Generate an HTML report based on ACI Fabric queries.
- Generate an HMTL report offline by ingesting the .json files previously downloaded from an ACI Fabric.
- Download the query responses as .json files onto the ansible controller.
- Use user/password authentication.
- Use certificate based, signature authentication.
- Ability to auto generate certificates for use in signature authentication.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Tested working with Ansible 3.3
Must have python3-pip and pandoc installed.
sudo apt install python3-pip
sudo apt install pandoc
sudo -H pip3 install jmespath jinja2 pandoc pyopenssl ansible
Mac
sudo -H pip3 install jmespath jinja2 pandoc pyopenssl ansible
brew install pandoc
From within the cisco-aci-documenter folder, issue the following command.
For Password Based Authentication
ansible-playbook -i aci_hosts document-aci.yml --tags pass
For Signature Based Authentication - Signature based authentication is compatible with ansible 3.0 or higher.
ansible-playbook -i aci_hosts document-aci.yml --tags sig
Optional json tag will copy the raw json response to ~/ansible_json_payload.
ansible-playbook -i aci_hosts document-aci.yml --tags pass,json
or
ansible-playbook -i aci_hosts document-aci.yml --tags sig,json
For Offline Mode - Offline mode must have the folder ~/ansible_json_payload
with .json files generated from aci-json-grabber.
ansible-playbook -i aci_hosts document-aci.yml --tags offline
Upon execution, the playbook will ask for user input.
Running the documenter will create a single .html file in your user’s home directory that contains a report of the ACI Fabric. After the play completes, check your home directory for the file. The users home directory is referenced with ~/
. Offline mode will allow documenter to ingest the .json files that have been outputted from the aci-json-grabber, to produce an HTML report. Adding the json tag will write the json responses to the ansible controller's disk.
If you get Unicode characters in your output, u
before some data, it's because ansible is using python2. Ansible documentation says the best way to correct this is to install ansible using pip3 so that ansible will default to python3. Run the play with -vvv in order to see which interpreter loads. During testing, the play seemed to ignore configurations specifying to execute with python3, due to this. In WSL the best and fastest work around was by uninstalling/reinstalling the shell, then installing ansible using pip3 first. MacOS has no reported issues so far.
- James Kayser - Initial work - kayserj
@ 2021 James Kayser All Rights Reserved