AWX and Netbox Inventory Plugin

Hello,

I am playing with the Netbox plugin for Ansible to get a dynamic inventory from Netbox.

There is any way to use this plugin from AWX?

Thanks in advance.

Cheers,
nrk

netbox inventory plugin:

https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/inventory/netbox.py

Create a custom credential type which will inject the environment variables:

  • NETBOX_API
  • NETBOX_API_KEY

Logically, the API key should be a secret field.

Now make a credential of this credential type, with your values.

Next, add a file to your source control. It must be called netbox_inventory.yml

Inside of this file, fill out the rest of the configuration you want to use. To be minimalistic, just have “plugin: netbox” in that file.

Now add an inventory source to one of your inventories. Source it from a project. For the source path, put in the relative path for your netbox_inventory.yml file.
update that.

Hi Alan!

I did a quick test yesterday and seems to work fine. Thanks for your advice!

Cheers,
nrk