# AWX and Netbox Inventory Plugin

**URL:** <https://forum.ansible.com/t/awx-and-netbox-inventory-plugin/29910>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [March 19, 2019, 1:37pm UTC](https://forum.ansible.com/t/awx-and-netbox-inventory-plugin/29910 "2019-03-19T13:37:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nrk](https://avatars.discourse-cdn.com/v4/letter/n/9de0a6/32.png) [@nrk](https://forum.ansible.com/u/nrk)\
**Post date:** [March 19, 2019, 1:37pm UTC](https://forum.ansible.com/t/awx-and-netbox-inventory-plugin/29910/1 "2019-03-19T13:37:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![AlanCoding](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/alancoding/32/301_2.png) [@AlanCoding](https://forum.ansible.com/u/AlanCoding)\
**Post date:** [March 19, 2019, 1:52pm UTC](https://forum.ansible.com/t/awx-and-netbox-inventory-plugin/29910/2 "2019-03-19T13:52:33Z")

</div>

netbox inventory plugin:

[https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/inventory/netbox.py](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.

---

<div class="post-metadata">

**Author:** ![nrk](https://avatars.discourse-cdn.com/v4/letter/n/9de0a6/32.png) [@nrk](https://forum.ansible.com/u/nrk)\
**Post date:** [March 20, 2019, 11:23am UTC](https://forum.ansible.com/t/awx-and-netbox-inventory-plugin/29910/3 "2019-03-20T11:23:35Z")

</div>

Hi Alan!

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

Cheers,  
nrk
