-
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
Fail module error when using variables as items in EL6 #20309
Comments
ping @jimi-c |
that condition does not make much sense, the following would be the correct way to write it
but that would never execute as |
What version of jinja2 is installed? (the Environment._generate() method causing the error was added in jinja 2.5) |
@alikins |
@bcoca, I agree the condition is not ideal but has worked with 2.2 until the most recent rc. Is it invalid syntax? |
Ansible is not currently working with the latest jinja2 (2.9), but we have not set bottom version requirements (which we might need now due to the fix for the security issue). |
@rmfitzpatrick it violates the 'no moustaches when when:' rule as it does double interpolation, which is not guaranteed to work. |
IF you need the double interpolation, look at doing:
possibly user the |
Looks like jinja2.2 jinja2.environment.Template doesnt have _generate(), but there is a jinja2.environment.generate() which could be used. And it looks like newer jinja2 still has the jinja2.environment.generate() so it could potentially be used from conditional.py |
Closing This TicketHi! We believe the above commit should resolve this problem for you. This will also be included in the next release. If you continue seeing any problems related to this issue, or if you have any further questions, please let us know by stopping by one of the two mailing lists, as appropriate:
Because this project is very active, we're unlikely to see comments made on closed tickets, but the mailing list is a great way to ask questions, or post if you don't think this particular issue is resolved. Thank you! |
Also cherry-picked to stable-2.2 and 2.1. |
After change in ansible/ansible#20309 Not using quote in RHEL6 will fail with: 'AnsibleEnvironment' object has no attribute '_generate' Change-Id: I581eb2b80e831c07ae942ed6c9a5fae326a69f0c Signed-off-by: Hao Liu <hliu@redhat.com>
Ansible is throwing the following during a conditional check for the fail module:
bisect shows that this was introduced in 86eadc5.
This is causing failures in Tower 3.0.3 installs.
ISSUE TYPE
ANSIBLE VERSION
OS / ENVIRONMENT
EL6. Not observed in EL7.
SUMMARY
The condition that uses variables for items is incorrectly parsed.
STEPS TO REPRODUCE
ansible-playbook -i inventory -e "var_one=123 var_two=234" repro.yml
The text was updated successfully, but these errors were encountered: