Skip to content

jizaymes/nornir_inventory_rancid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nornir-rancid_inventory

This is a really basic plugin for nornir to use an existing RANCID installation as inventory for nornir. It will assemble the info from the various rancid router.db files, as well as basic authentication info out of .cloginrc

It gets initialized in the nornir config.yaml passing in the path to rancid. An example structure is included in the rancid folder.

inventory:
    plugin: "rancid_inventory.rancid_inventory.RancidInventory"
    options:
        rancid_path: "rancid"

The included rancid.py is an example to walk through your rancid inventory, detecting what groups to look for devices in by checking the rancid_path/etc/rancid.conf config variable LIST_OF_GROUPS, ex. LIST_OF_GROUPS="routers switches firewalls"

% python rancid.py 
{'cr2.lga6.company.local': Host: cr2.lga6.company.local, 'ms01.bos1.company.local': Host: ms01.bos1.company.local}
{'routers': Group: routers, 'switches': Group: switches}

About

Inventory plugin for Nornir to utilize an existing RANCID configuration

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages