Ansible AWX requires inventories to be entered in yaml or json format.
When you start learning ansible, you may take the choice to start off with your inventory in ini format.
https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html
Is it possible to convert between formats?
ansible. builtin. yaml inventory – Uses a specific YAML file as an inventory source.
INI file based inventory, sections are groups or group related with special :modifiers . Entries in sections [group_1] are hosts, members of the group. Hosts can have variables defined inline as key/value pairs separated by = . The children modifier indicates that the section contains groups.
Example given here
https://evrard.me/convert-ansible-inventories-with-ansible-inventory-cli
ansible-inventory -i inventory.ini -y --list > inventory.yaml
The -y
flag gives yaml output.
Omitting the flag gives json.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With