-
Notifications
You must be signed in to change notification settings - Fork 700
Don't pass deprecated disable_lookups to template function #4593
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
Conversation
Not sure if ansible-lint only supports the latest ansible version, or a range. In the latter case this should probably fall back to setting it again in < 2.19. |
1a5ca3c
to
2c7b6e9
Compare
…sible#4592) From the ansible 2.19 release notes: - templating - The ``disable_lookups`` option has no effect, since plugins must be updated to apply trust before any templating can be performed. So remove it.
bda9ef4
to
e2e508c
Compare
This (very likely) causes unwanted code execution, see #4643. |
Hi @leegarrett, we're going to revert this change and release a patch fix because of #4643. If you could augment this change with a fix for the issue, that would be great. It appears there should be a version check, as you suggested in a comment originally. |
I think the only proper fix is to stop evaluating Jinja2 expressions. This has always been problematic and dangerous (see #2681). Imagine a collection where one lookup deletes every file in your home folder. If the collection also contains a role that has a template expression somewhere that calls the lookup, running ansible-lint on that collection will wipe all your files. This is not something folks expect to happen when running a linter. Also the core team seems to be completely unaware of ansible-lint using |
I'm fine with it being reverted. I however have no deeper knowledge on how to properly fix this and will pass on it. I just naively went with the 2.19 changelog, removed it, and gave it a quick test on my set of playbooks. |
@leegarrett Thanks for the update, completely understood. |
@leegarrett We reverted this due to regression being detected. It will need to be redone with modifications to prevent that regression from happening. |
I started a discussion here: #4652 |
From the ansible 2.19 release notes:
disable_lookups
option has no effect, since plugins must be updated to apply trust before any templating can be performed.Fixes: #4592