Replies: 3 comments 1 reply
-
I am running into this too. Does anyone have any thoughts on this? "{{ variable_name_from_playbook }}": "{{ lookup('ansible.builtin.sometask', **criteria ) }}"
vars:
criteria:
critera1:
critera2: |
Beta Was this translation helpful? Give feedback.
-
I appreciate all the effort to maintain high standards with ansible-lint rules, but I often find myself puzzled by the lack of explanations for some of these rules, and I believe I am not the only one that uses ansible-lint as a reference to write better ansible code. For instance, Shellcheck does an excellent job at this by not only enforcing rules but also explaining the potential pitfalls of violating them, and even highlighting scenarios where a rule may not apply. Thank you for considering this feedback. |
Beta Was this translation helpful? Give feedback.
-
I am also confused by the purpose of this rule. Templating variables is powerful and helpful in many scenarios. Please define why it is undesirable in the documentation. This rule is joining the skip-list for me. |
Beta Was this translation helpful? Give feedback.
-
Hello,
Such a basic example task, with variable name templating:
... works fine, but ansible-lint (as expected to current rules) returns:
But I cannot find any information why this is actually a bad practice? Could you please explain?
I've only found only a single thing in this topic which is ansible-lint issue (relatively old as from 2021) #1680 , where it seems like templating variables was acceptable at that point of time.
Additionally, ansible-lint finds this violation only when used in playbook, while the same task defined in role is not flagged.
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions