-
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
Regression: Ansible 1.9.5-1 does not load group or host variables #15093
Comments
We also ran into this (ansible not loading variables in |
Agreed, this is an absolute showstopper. Frankly I'm a little shocked that this kind of thing can get through unnoticed, it does not say good things about the release testing process. Also disappointing to see no activity on an issue like this for 17 hours. |
As a temporary workaround, if you are able to reference the hosts file directly instead of referencing the directory that it is inside of, then it will work. Figuring out what the difference between those two cases is now.
|
@jbouzekri I just checked and this bug is not present on 2.0.1.0 or devel. So looks like these are separate bugs. |
After comparing current code in stable-1.9 to code in devel I think that commit e856ac2 is wrong. The limit bug that was intended to fix is because something is not looking at runner.basedir (the equivalent of 2.x's vars['playbook_dir']). e856ac2 is modifying the basedir found for inventory rather than the one found for playbooks so it is doing the wrong thing. I'm going to revert that now in stable-1.9 and then look for where the runner.basedir is being omitted when limit is given. |
This reverts commit e856ac2. That commit was intended to fix --limit not honoring the playbook directory as a source of inventory variable information. However, the commit changes the inventory basedir to where it thinks the playbook basedir which breaks finding inventory variables inside of inventory directories #15093. Reverting this and looking for where limit might be affecting the playbook basedir rather than the inventory basedir.
@abadger Confirmed that it works now in stable-1.9, both with my test case and with our production inventory. Thank you! Hope there will be a test case for the "inventory is directory" case from now on. Will you be making a bugfix release considering the showstopper nature of this bug? |
@nikut yes, there will be a 1.9.6... We're looking at one more bug on the 1.9 release and then we'll be putting out a release candidate. If you'd like to make a pull request for an integration test of inventory is directory, that would be a great way for us to expand test coverage of this. Integration tests are ansible playbooks that use the assert module to show that the test conditions are met. They live here: https://github.com/ansible/ansible/tree/devel/test/integration |
Issue Type:
Ansible Version:
Ansible Configuration:
Default
Environment:
Control host CentOS 5.11 or OS X 10.11.3, managed host is not relevant
Summary:
Ansible 1.9.5-1 does not load group or host variables from the inventory at all. This is a regression from 1.9.4-1.
Steps To Reproduce:
This is a synthetic test case but the same occurs in our production environment with normal playbooks and with all hosts causing massive breakage.
inventory/hosts:
inventory/group_vars/all:
inventory/group_vars/test:
inventory/host_vars/localhost:
Expected Results:
On 1.9.4-1:
Actual Results:
On 1.9.5-1:
The text was updated successfully, but these errors were encountered: