Inventory¶
This page has a few examples that people have had questions about in the past. Please visit the inventory plugin documentation page for the full reference.
Using Compose to Set ansible_network_os
to Platform Network Driver¶
You can also use custom fields on the device or a nested object.
---
plugin: networktocode.nautobot.inventory
compose:
device_owner: custom_fields.device_owner
ansible_network_os: platforms.custom_fields.ansible_network_os
Using Keyed Groups to set ansible_network_os
to Platform Network Driver¶
---
plugin: networktocode.nautobot.inventory
keyed_groups:
- key: platform
prefix: "network_os"
separator: "_"
Note
The above examples are excerpts from the following blog post.
Using Inventory Plugin Within AWX/Tower¶
This will cover the basic usage of the Nautobot inventory plugin within this collection.
- Define
collections/requirements.yml
within a Git project. - AWX/Tower will download the collection on each run. This can be handled differently or excluded if storing Ansible Collections on the AWX/Tower box.
- Define
inventory.yml
in Git project that adheres to inventory plugin structure. - Add Git project to AWX/Tower as a project.
- Create inventory and select
source from project
. - Select the AWX/Tower project from Step 2
- Select the
inventory.yml
file in the project from Step 3 - Make sure your Tower installation uses Python 3 or select the proper
ANSIBLE ENVIRONMENT
- Click
Save
and sync source.