ansible.builtin.host_list inventory – Parses a ‘host list’ string


This inventory plugin is part of ansible-core and included in all Ansible installations. In most cases, you can use the short plugin name host_list even without specifying the collections: keyword. However, we recommend you use the FQCN for easy linking to the plugin documentation and to avoid conflicting with other collections that may have the same inventory plugin name.

New in Ansible 2.4


  • Parses a host list string as a comma separated values of hosts

  • This plugin only applies to inventory strings that are not paths and contain a comma.


# define 2 hosts in command line
# ansible -i ',' -m ping all

# DNS resolvable names
# ansible -i ', host2' -m user -a 'name=me state=absent' all

# just use localhost
# ansible-playbook -i 'localhost,' play.yml -c local


Configuration entries for each entry type have a low to high priority order. For example, a variable that is lower in the list will override a variable that is higher up.