Sunday, March 13, 2016

Ansible and cisco

I pushed a collection of Ansible modules for cisco IOS routers on my Github .
There are two modules with an example for using them: one of the modules gather some usefull facts from cisco IOS routers and the other module execute in a cisco IOS router a list of commands from a file.
The cisco_exec_commands module doesn't replace the ansible core module that do the same (http://docs.ansible.com/ansible/list_of_network_modules.html#ios), it's only another usefull module that can be run in version 1.7.0.

The facts gathered by cisco_gather_facts can be used as inputs to other modules or can be used in templates to create documentation used for inventorying, assessments, etc.

The playbook example adds a VRF and some interfaces in the VRF. In order to do that, the playbook has the following tasks:

  Search in BGP Reflector routers of de network if the RD you want to configure already exists.
  Search in BRAS if a VRF with the same name exists.
  Adds the new VRF, some interfaces, and place the interfaces in the VRF.

And here is de link: https://github.com/AntonioArriaga/ansible-cisco


NOTE: I used netlib python module from https://github.com/jtdub/netlib

UPDATE (04/04/2016): I added a module that connects to cisco via serial console port and an example of use of this module.

No comments:

Post a Comment