Skip to content
/ ACY Public

The idea is to manage the Cisco ACI configuration via text files in YAML format.

License

Notifications You must be signed in to change notification settings

nihole/ACY

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

ACY

ACY = deployment Cisco ACI from Yaml = ACI from Yaml

Thus, ACY is rather the name of the approach, than the name of the software product.

The idea is to manage the Cisco ACI configuration via text files in YAML format. It allows you to

  • use a simple interface for ACI configuration
  • think about the configuration parameters only and not about the command's syntax or GUI-navigation
  • use version control systems (for example, based on git) and follow the best practices of development for network infrastructure changes control

Installation

  • clone this project to your local folder
  • install Python3 with YAML and Jinja2 packages
  • install Postman

Which ACI objects can be managed with ACY

In the current version of ACY, you can create, modify, or delete the following ACI objects:

  • Access policies:
    • Global access policies:
      • vlan pools
      • physical domains
      • l3out domains
      • vmm domains
      • aaep
    • Interface access policies:
      • interface policies
      • interface policy groups
      • interface profiles
      • FEX interface profile
    • Switch access policies:
      • node provisioning
      • mgmt ip addresses
      • switch policy groups
      • switch profiles
      • FEX provisioning (not ready)
  • Tenants:
    • tenants
    • contexts
    • bridge domais
    • application profiles
    • EPGs
    • EPG static bindings
  • L3OUT:
    • l3outs
    • l3out node profiles
    • l3out interface profiles
    • external EPGs
  • Contracts:
    • filters
    • contracts
    • EPG attachment

Configuration procedure

The procedure is simple and mainly consists of three steps:

  • fill in the YAML file
  • generate the XML configuration file
  • upload it to ACI.

You never change the Python rendering file render.py and generally you don't need to change Jinja2 templates.

Example

All steps described here have already been completed. So you don't actually have to do anything, and you can just click the links and view the configuration files. The configuration of all objects in the example 1 has been tested on Cisco dCloud LAB.

Let's consider, for example, that we want to create a new VLAN pool.

  1. Go to the correspondent folder. In this case it is access_policies/global_policy/vlan_pools

There are 2 files already there: template.j2 and vlan_pools_tmpl.yml.

  • template.j2 - is Jinja2 template. You usually don't need to change it.
  • vlan_pools_tmpl.yml - this YAML file we are going to use for our YAML file creation (if it has not been done before)
  1. Create a new folder (if it has not been done before). Actually you may use any folder, but it looks reasonable to create a new folder in the current one. Let's create a folder example1 /render
mkdir example1
  1. Copy file vlan_pools_tmpl.yml (if it has not been done before) to this folder and rename it:
cp vlan_pools_tmpl.yml ./example1/vlan_pools.yml
cd ./example1/
  1. Fill in vlan_pools.yml with configuration parameters

  2. Generate aaep.xml file for ACI configuration

python3 ../../../../render.py ../template.j2 vlan_pools.yml > vlan_pools.xml
  1. Upload this file to ACI (see the next chapter).

Upload configuration to ACI

The described approach can result in many XML files. We can use many API requests to load these files into ACI, but this does not look very scalable.

This project provides a tool to collect individual API requests into one Postman collection.

  1. Go to the folder postman
cd postman

There are 3 files here:

  1. Create a folder example1 (if it has not been done before). Actually you may use any folder, but it looks reasonable to creare a new folder in the curent one.
mkdir example1
  1. Copy file collection_tmpl.yml to the new folder with renaming. For example a new name maybe all.yml
cp collection_tmpl.yml example1/all.yml
  1. Fill in a new file all.yml

  2. Generate collection file all.json

cd example1
../create_collection.py ../template.j2 all.yml > all.json
  1. Start Postmat and import this collection

  2. Run this collection in Postman

About

The idea is to manage the Cisco ACI configuration via text files in YAML format.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published