Skip to content

a-delannoy/yaani

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yaani - Yet another Ansible Netbox inventory

Yaani is an Ansible dynamic inventory script designed to source its data from the Netbox API. A configuration file written in YAML is used to describe the desired shape of the inventory. It can be used along with Ansible when running a playbook, for example :

Ansible-playbook -i yaani.py my-playbook.yml

It can also be used on a standalone basis, calling its cli options manually.

usage: yaani.py [-h] [-c CONFIG_FILE] [--list] [--host HOST]

optional arguments:
  -h, --help            show this help message and exit
  -c CONFIG_FILE, --config-file CONFIG_FILE
                        Path for script's configuration file. If None is
                        specified, default value is YAANI_CONFIG_FILE
                        environment variable or netbox.yml in the current dir.
  --list                Print the entire inventory with hostvars respecting
                        the Ansible dynamic inventory syntax.
  --host HOST           Return an empty inventory.

Getting started

Installation

In order to install Yaani, you can clone the repository:

git clone https://github.com/a-delannoy/yaani.git

and install its dependencies:

make install

In case make is not installed, simply run: pip3 install -r requirements.txt

Please consider that in order to be installed, pyjq has to be built on the machine. Therefore it needs execution rights on the partition it is built on. Pyjq also has some system packages dependencies :

[...]
You will need flex, bison (3.0 or newer), libtool, make, automake and autoconf to build jq. Install them by Homebrew, APT or other way.
[...]

Requirements

All the requirements are provided in the requirements.txt file in a pip3 freeze fashion.

First step

Fore more information about how to use dynamic inventory plugin, please visit https://github.com/Cloud-Temple/yaani/wiki/Home-Page

About

Yet another Ansible Netbox inventory

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.9%
  • Makefile 0.1%