Bookmark this page

Summary

  • You can use inventory plug-ins provided by collections to dynamically obtain lists of hosts and groups from sources such as cloud, virtualization, and systems management platforms.

  • Dynamic inventory scripts can generate host and group information from sources external to Ansible.

  • You can use the yaml inventory plug-in to write static inventory files in YAML format.

  • You can use the ansible-navigator inventory command to help you convert an inventory file in INI format into YAML format.

  • A good practice is to keep most variables out of static inventory files.

  • Take advantage of inventory groups and the group_vars/ and host_vars/ directories to improve project maintainability.

  • Use the special inventory variables to control connections to hosts and use inventory hostnames to make playbook output more readable.

Revision: do374-2.2-82dc0d7