![]() If your YAML configuration files are directories, you should name them so that the inventory source works. If an inventory plugin is enabled, it is as simple as providing an inventory source. In most cases, you must whitelist your ansible.cfg file if you want to disable a significant number of inventory plugins shipped with Ansible. You can learn more about the ini plugin and other inventory plugins in the Ansible documentation.ĭata sources can be used to create the inventory of hosts that Ansible uses to target tasks in an inventory plugin. For example, to use the ini plugin, you would add the following line to your inventory file: ! ini The ini plugin reads inventory files in INI format. To use an inventory plugin, specify the name of the plugin in the inventory file, preceded by a bang (!) character. If you have a custom inventory plugin, you can place it in this directory or in any directory listed in the ANSIBLE_INVENTORY_PLUGINS environment variable. Inventory plugins are located in the /etc/ansible/inventory/ directory. You can also specify a comma-separated list of inventory files. By default, Ansible will look for an inventory file called /etc/ansible/hosts, but you can specify a different file using the -i /path/to/file command line option. Ansible inventory plugins allow you to use different types of files and data sources to define your inventory of hosts.
0 Comments
Leave a Reply. |