mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
ungrouped as a list (#50593)
* update the developing_inventory docs to show ungrouped as a dict with a "children" key; avoid [WARNING]: Found both group and host with same name: ungrouped
This commit is contained in:
parent
df3b973cec
commit
1f06b3ca7d
1 changed files with 17 additions and 12 deletions
|
@ -318,19 +318,24 @@ If you intend to replace an existing static inventory file with an inventory scr
|
||||||
it must return a JSON object which contains an 'all' group that includes every
|
it must return a JSON object which contains an 'all' group that includes every
|
||||||
host in the inventory as a member and every group in the inventory as a child.
|
host in the inventory as a member and every group in the inventory as a child.
|
||||||
It should also include an 'ungrouped' group which contains all hosts which are not members of any other group.
|
It should also include an 'ungrouped' group which contains all hosts which are not members of any other group.
|
||||||
A skeleton example of this JSON object is::
|
A skeleton example of this JSON object is:
|
||||||
|
|
||||||
{
|
.. code-block:: json
|
||||||
"_meta": {
|
|
||||||
"hostvars": {}
|
{
|
||||||
},
|
"_meta": {
|
||||||
"all": {
|
"hostvars": {}
|
||||||
"children": [
|
},
|
||||||
"ungrouped"
|
"all": {
|
||||||
]
|
"children": [
|
||||||
},
|
"ungrouped"
|
||||||
"ungrouped": {}
|
]
|
||||||
}
|
},
|
||||||
|
"ungrouped": {
|
||||||
|
"children": [
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
An easy way to see how this should look is using :ref:`ansible-inventory`, which also supports ``--list`` and ``--host`` parameters like an inventory script would.
|
An easy way to see how this should look is using :ref:`ansible-inventory`, which also supports ``--list`` and ``--host`` parameters like an inventory script would.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue