W3cubDocs

/Ansible 2.11

ansible.builtin.advanced_host_list – Parses a ‘host list’ with ranges

Note

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

New in version 2.4: of ansible.builtin

Synopsis

  • Parses a host list string as a comma separated values of hosts and supports host ranges.
  • This plugin only applies to inventory sources that are not paths and contain at least one comma.

Examples

# simple range
# ansible -i 'host[1:10],' -m ping

# still supports w/o ranges also
# ansible-playbook -i 'localhost,' play.yml

© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.11/collections/ansible/builtin/advanced_host_list_inventory.html