It seems common practice for playbooks to have a “hosts” file in the root of the playbook.
When you run a playbook you have to supply it via the -i parameter, otherwise you will get the error: “ERROR: Unable to find an inventory file, specify one with -i ?”
It would be nice if Ansible would automaticly detect the hosts file in the playbook folder. Less arguments would make it even easier to use.
I think explicitly passing in the inventory is OK: pretty soon you’ll have at least two of them (staging/prod etc.), and you REALLY don’t want to apply changes to the wrong set of hosts
If you still want to set a default inventory path, you can do this through ANSIBLE_HOSTS environment variable or by setting “hostfile” in ansible.cfg