INI inventory plugin: add documentation about variable types (#25798)

* INI inventory: check variable types
* INI inventory: add doc about variable types

Fixes #25784
This commit is contained in:
Pilou 2017-07-13 21:04:20 +02:00 committed by Matt Clay
commit 2a92120ffa
3 changed files with 24 additions and 3 deletions

View file

@ -60,6 +60,10 @@ Suppose you have just static IPs and want to set up some aliases that live in yo
In the above example, trying to ansible against the host alias "jumper" (which may not even be a real hostname) will contact 192.0.2.50 on port 5555. Note that this is using a feature of the inventory file to define some special variables. Generally speaking this is not the best
way to define variables that describe your system policy, but we'll share suggestions on doing this later. We're just getting started.
.. note:: Values passed in using the ``key=value`` syntax are interpreted as Python literal structure (strings, numbers, tuples, lists, dicts,
booleans, None), alternatively as string. For example ``var=FALSE`` would create a string equal to 'FALSE'. Do not rely on types set
during definition, always make sure you specify type with a filter when needed when consuming the variable.
Adding a lot of hosts? If you have a lot of hosts following similar patterns you can do this rather than listing each hostname:
.. code-block:: ini