Skip to content

Commit 4b38639

Browse files
authored
Add examples for using the inventory plugin in Ansible Tower (AWX) (#648)
1 parent a831771 commit 4b38639

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

plugins/inventory/nb_inventory.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,28 @@
253253
keyed_groups:
254254
- prefix: status
255255
key: status.value
256+
257+
# For use in Ansible Tower (AWX), please see this blog from RedHat: https://www.ansible.com/blog/using-an-inventory-plugin-from-a-collection-in-ansible-tower
258+
# The credential for NetBox will need to expose NETBOX_API and NETBOX_TOKEN as environment variables.
259+
# Example Ansible Tower credential Input Configuration:
260+
261+
fields:
262+
- id: NETBOX_API
263+
type: string
264+
label: NetBox Host URL
265+
- id: NETBOX_TOKEN
266+
type: string
267+
label: NetBox API Token
268+
secret: true
269+
required:
270+
- NETBOX_API
271+
- NETBOX_TOKEN
272+
273+
# Example Ansible Tower credential Injector Configuration:
274+
275+
env:
276+
NETBOX_API: '{{ NETBOX_API }}'
277+
NETBOX_TOKEN: '{{ NETBOX_TOKEN }}'
256278
"""
257279

258280
import json

0 commit comments

Comments
 (0)