8000 jinja[spacing] invalid suggestion · Issue #4588 · ansible/ansible-lint · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

jinja[spacing] invalid suggestion #4588

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

Open
Dofamin opened this issue Apr 19, 2025 · 0 comments
Open

jinja[spacing] invalid suggestion #4588

Dofamin opened this issue Apr 19, 2025 · 0 comments
Labels

Comments

@Dofamin
Copy link
Dofamin commented Apr 19, 2025
Summary

We got the following warning on our code base associated to an invalid suggestion.
We cant fix the underlying spacing issue, and suggestion will be not working too

Jinja2 spacing could be improved: rabbitmqctl set_user_limits "{{ item.username }}" '{ {{- item.limits -}} }'
 -> rabbitmqctl set_user_limits "{{ item.username }}" '{{{- item.limits -}} }'
ansible-lint[jinja[spacing]](https://ansible.readthedocs.io/projects/lint/rules/jinja/)

after applying suggestion

tasks/rabbitmq-acl.yml:75: jinja[invalid][/]: template error while templating string: unexpected '}'. String: rabbitmqctl set_user_limits "{{ item.username }}" '{{{- item.limits -}} }'
. unexpected '}'
Issue Type
  • Bug Report
OS / ENVIRONMENT
System Version: macOS 15.3.2 (24D81)
Kernel Version: Darwin 24.3.0
ansible [core 2.18.4]
python version = 3.13.3
ansible-lint 25.2.1 using ansible-core:2.18.4 ansible-compat:25.1.5 ruamel-yaml:0.18.10 ruamel-yaml-clib:None
  • ansible installation method: brew
  • ansible-lint installation method: brew
STEPS TO REPRODUCE
$ git clone git@github.com:Dofamin/poc-ansible-lint-jinja2.git
$ cd poc-ansible-lint-jinja2/
$ ansible-lint -v --show-relpath -f pep8 --profile production --skip-list=role-name,meta-incorrect  --exclude meta
Desired Behavior

The suggestion wont need

Actual Behavior

Please give some details of what is happening. Include a minimum complete
verifiable example
with:

  • minimized playbook to reproduce the error
  • the output of running ansible-lint including the command line used
  • if you're getting a stack trace, also the output of
    ansible-playbook --syntax-check playbook

@Dofamin Dofamin added bug new Triage required labels Apr 19, 2025
@audgirka audgirka removed the new Triage required label Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

2 participants
0