YAML inventory format now deprecated in 0.6, gone in 0.7, here's a conversion script to switch to INI

I wrote a conversion script that helps users move from the YAML format to the INI format.

The YAML parser now prints out a deprecation notice, this is the last release where the YAML inventory parser will be functional. It will work in 0.6 and will be removed completely in 0.7, though the conversion script will continue to live in the repo for a few more releases after that.

To convert your inventory from YAML to INI, run the following:

    python examples/scripts/yaml_to_ini.py <path_to_inventory_file>

It will overwrite any group_vars and host_vars, but will not overwrite your actual inventory file, instead saving it as a different file name and telling you about all the files it created.

See my previous email about group_vars and host_vars and how that works to enable saving structured data via INI. This is 100% compatible and we are migrating using the exact same parser code that the app used, so all your structured YAML variables will be moved over automatically.

Let me know if there are any problems or questions.

--Michael

Oops … I’m pretty new to Ansible and thought that since the YAML inventory format was new, it must be the way forward (plus my playbooks are in YAML so why not also do the inventory that way). Fortunately my corpus is small (3 inventories with a couple dozen lines each) and providing a conversion script is very user friendly.

Thanks,

smoyer

Correct, YAML was done as a way to be able to support structured data
(lists, hashes) because there was no way to do it in the INI format,
that was it.

Ultimately it causes confusion when people are sharing inventory in
two formats, or explaining when someone should pick A or B, or how to
avoid errors in the YAML format version. It did a very good service
to Ansible at the time though, and that we had a way to represent
those things has been valuable.