You cannot change the path for host_vars and group_vars .
These paths always apply to your hostfile . You can install the standard host file in your indispensable configuration:
hostfile = /path/to/hostfile/hostfile.ini
in this case your default host_vars is in
/path/to/hostfile/host_vars/
You can also use multiple host files, assuming you have:
/path/to/your/project/inventory/inventory.ini
from host_vars to
/path/to/your/project/inventory/host_vars/
In this case, you can call the opportunity anywhere using:
ansible -i /path/to/your/project/inventory/inventory.ini my_playbook.yml
Just remember: host_vars and group_vars are associated with your inventory (hostfile) and so you can change the location of inventory and put below host_vars below.
ProfHase85
source share