-
Notifications
You must be signed in to change notification settings - Fork 664
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
Fix detection of play roles vars missing prefix #3765
Conversation
@@ -126,6 +126,36 @@ def main(): | |||
"pre_tasks", | |||
"post_tasks", | |||
] | |||
PLAYBOOK_ROLE_KEYWORDS = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I derived this list of playbook role keywords from here https://docs.ansible.com/ansible/latest/reference_appendices/playbooks_keywords.html#role.
results = Runner( | ||
Lintable("examples/playbooks/role_vars_prefix_detection.yml"), | ||
rules=default_rules_collection, | ||
exclude_paths=["examples/roles/role_vars_prefix_detection"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exclude_paths
was set because otherwise the runner picks up the violations from the role too, I presume this happens because the playbook invokes said role.
role_vars_prefix_detection_var1: val1 | ||
|
||
- role: role_vars_prefix_detection | ||
vars: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Side blurb, I would think one would want to put role variables under the vars
key instead of mixing them in the same dictionary as the role name. This would prevent confusion with a playbook's role keywords.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok to me but I want another pair of eyes on it, in case I missed something, especially as I almost never user roles:
blocks myself, as I prefer to use them inside tasks.
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [ansible-lint](https://github.com/ansible/ansible-lint) ([changelog](https://github.com/ansible/ansible-lint/releases)) | patch | `==6.20.0` -> `==6.20.1` | --- ### Release Notes <details> <summary>ansible/ansible-lint (ansible-lint)</summary> ### [`v6.20.1`](https://github.com/ansible/ansible-lint/releases/tag/v6.20.1) [Compare Source](ansible/ansible-lint@v6.20.0...v6.20.1) #### Bugfixes - Fix detection of play roles vars missing prefix ([#​3765](ansible/ansible-lint#3765)) [@​cavcrosby](https://github.com/cavcrosby) - Prune reported errors after autofix ([#​3774](ansible/ansible-lint#3774)) [@​cidrblock](https://github.com/cidrblock) - `--fix` will now default to `all` ([#​3777](ansible/ansible-lint#3777)) [@​ajinkyau](https://github.com/ajinkyau) - Avoid false error caused by TypeError with jinja rule ([#​3773](ansible/ansible-lint#3773)) [@​ssbarnea](https://github.com/ssbarnea) - Sanity Rule Ignore Additions and Updates ([#​3766](ansible/ansible-lint#3766)) [@​alisonlhart](https://github.com/alisonlhart) - Update rulebook schema (name is now required) ([#​3776](ansible/ansible-lint#3776)) [@​ssbarnea](https://github.com/ssbarnea) - Expose rules that have autofix capability in docs ([#​3770](ansible/ansible-lint#3770)) [@​shatakshiiii](https://github.com/shatakshiiii) - List all the fixable rules in CLI via `--list-rules` ([#​3737](ansible/ansible-lint#3737)) [@​shatakshiiii](https://github.com/shatakshiiii) - Include level in SARIF results ([#​3758](ansible/ansible-lint#3758)) [@​ssbarnea](https://github.com/ssbarnea) - Meta runtime supported version update ([#​3755](ansible/ansible-lint#3755)) [@​alisonlhart](https://github.com/alisonlhart) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4wLjEiLCJ1cGRhdGVkSW5WZXIiOiIzNy4wLjEiLCJ0YXJnZXRCcmFuY2giOiJtYWluIn0=--> Reviewed-on: https://git.home/nrdufour/home-ops/pulls/120 Co-authored-by: Renovate <[email protected]> Co-committed-by: Renovate <[email protected]>
Fixes #3668.