I’m segregating my development from my production inventories, and somewhat following the advice given in Laying out roles, inventories and playbooks. I therefore have the following directory structure.
`
/path_to_playbook/inventories
/path_to_playbook/inventories/development/hosts
/path_to_playbook/inventories/development/hosts/host_file_1
/path_to_playbook/inventories/development/hosts/host_file_2
/path_to_playbook/inventories/production/hosts
/path_to_playbook/inventories/production/hosts/host_file_1
/path_to_playbook/inventories/production/hosts/host_file_2
`
Now how can I write an ansible ad-hoc command to ping all the hosts in the /path_to_playbook/inventories/development/hosts directory? I don’t want to create a /path_to_playbook/inventories/development/hosts/all_hosts file that will contain the hosts in the host_file_* files since that will be hard to maintain