ansible / ansible.builtin / v2.9.21 / inventory / ini Uses an Ansible INI file as inventory source. | "added in version" 2.4 of ansible.builtin" Authors: unknownansible.builtin.ini (v2.9.21) — inventory
pip
Install with pip install ansible==2.9.21
INI file based inventory, sections are groups or group related with special `:modifiers`.
Entries in sections C([group_1]) are hosts, members of the group.
Hosts can have variables defined inline as key/value pairs separated by C(=).
The C(children) modifier indicates that the section contains groups.
The C(vars) modifier indicates that the section contains variables assigned to members of the group.
Anything found outside a section is considered an 'ungrouped' host.
Values passed in the INI format using the ``key=value`` syntax are interpreted differently depending on where they are declared within your inventory.
When declared inline with the host, INI values are processed by Python's ast.literal_eval function (U(https://docs.python.org/2/library/ast.html#ast.literal_eval)) and interpreted as Python literal structures (strings, numbers, tuples, lists, dicts, booleans, None). Host lines accept multiple C(key=value) parameters per line. Therefore they need a way to indicate that a space is part of a value rather than a separator.
When declared in a C(:vars) section, INI values are interpreted as strings. For example C(var=FALSE) would create a string equal to C(FALSE). Unlike host lines, C(:vars) sections accept only a single entry per line, so everything after the C(=) must be the value for the entry.
Do not rely on types set during definition, always make sure you specify type with a filter when needed when consuming the variable.
See the Examples for proper quoting to prevent changes to variable type.