dynamic inventory and ungrouped hosts. might be a documentation thing

using ansible 2.2.1.0, a dynamic inventory script will leave out hosts that are not in a group, unless you list them in hosts. should this be fixed in the docs? is there a better way?

`

#!/bin/sh

cat <<EOF
{
“red”: {
“hosts”: [
“alpha”,
“bravo”
]
},
“_meta”: {
“hostvars”: {
“alpha”: {
“ansible_host”: “192.168.0.1”
},
“bravo”: {
“ansible_host”: “192.168.0.2”
},
“charlie”: {
“ansible_host”: “192.168.0.3”
},
“delta”: {
“ansible_host”: “192.168.0.4”
}
}
}
}
EOF

`

$ ansible all --list-hosts hosts (2): alpha bravo

adding a hosts list fixes it,

`
#!/bin/sh

cat <<EOF
{
“hosts”: [
“alpha”,
“bravo”,
“charlie”,
“delta”
],
“red”: {
“hosts”: [
“alpha”,
“bravo”
]
},
“_meta”: {
“hostvars”: {
“alpha”: {
“ansible_host”: “192.168.0.1”
},
“bravo”: {
“ansible_host”: “192.168.0.2”
},
“charlie”: {
“ansible_host”: “192.168.0.3”
},
“delta”: {
“ansible_host”: “192.168.0.4”
}
}
}
}
EOF
`

`
$ ansible all --list-hosts
hosts (4):
alpha
bravo
charlie
delta

`