Dynamic device inventory
Dynamic inventory is the process of building the Ansible device inventory by programmatically querying a source of truth (SoT) system for all devices. Because the inventory is generated directly from the SoT, it always reflects the current state of your network, can be refreshed easily, and eliminates the need to maintain a static inventory file manually. The Ansible plugin you configure is responsible for generating the inventory and for any filtering or advanced querying capabilities.
IAG supports dynamic inventory through a variety of Ansible plugins available from the Ansible and open source communities. The following plugins are covered in this documentation:
General workflow
While the configuration details vary by plugin, setting up dynamic inventory in IAG follows the same general pattern for most plugins.
Install the plugin
Use ansible-galaxy to install the Ansible collection for your SoT system into IAG.
Configure Ansible to use the plugin
Update /etc/ansible/ansible.cfg to enable the plugin and set any required defaults such as interpreter_python, collections_path, and INVENTORY_ENABLED.
Configure the host file
Create an inventory file in the IAG inventory directory (typically /opt/automation-gateway/ansible/inventory/) and configure it to connect to and query your SoT system.
Some plugins require additional steps beyond this general workflow — for example, installing multiple collections, configuring a connection plugin, or setting up SSH keys. Refer to the plugin-specific documentation for details.