-
Notifications
You must be signed in to change notification settings - Fork 23.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
inventory option in config ignored #11907
Comments
i just tested this and it works for me, considering that "/etc/ansible/ansible_hosts" is not the default, could you have another entry or another ansible.cfg pointing at that? if you run with -v ansible should show which ansible.cfg it is using. |
Ansible is using the correct config file. I made sure other options are not ignored. it is only the option for the inventory.
I just pulled from devel branch before testing this again with commit Now downgrading and running the same again:
|
Do you have ANSIBLE_HOSTS or ANSIBLE_INVENTORY set in your environment? |
Indeed, I had this value in my
That was from when I first tried Ansible about 1,5 years ago and does not reflect my current setup. Removing the entry now solved the problem. So it seems like the precedence has changed. In 1.9.x the settings in Is this change expected? I wasn't able to find a statement in the docs how the precedence actually should be. I think it made more sense the way it used to be. When you have different projects you probably have an |
Its a mismatch, for backwards compatibility ansible_hosts has precedence over ansible_inventory, but it gets set to ANSIBLE_HOSTS which then makes ANSIBLE_HOSTS trump ansible_inventory unintentionally. |
it was actually intended the other way around in but the switch to v2 messed with that code |
I just updated my Ansible clone from the master branch.
The
inventory
option in theansible.cfg
now is ignored.This used to work in all previous versions (since inventory was introduced as config option)
The text was updated successfully, but these errors were encountered: