Listing hosts

When the --list argument is passed to an inventory script, Ansible expects the JSON output data to have a set of top-level keys. These keys are named for the groups in the inventory. Each group gets its own key. The structure within a group key varies depending on what data needs to be represented in the group. If a group just has hosts and no group-level variables, the data within the key can simply be a list of host names. If the group has variables or children (a group of groups), then the data needs to be a hash, which can have one or more keys named hosts, vars, or children. The hosts and children subkeys have a list value, a list of the hosts that exist in the group, or a list of the child groups. The vars subkey has a hash value, where each variable's name and value is represented by a key and value.