Replies: 1 comment
-
For tasks, I believe both of your answers would be acceptable. It's - name: Named block
block:
- name: Task 1
etc: ...
- name: Task 2
etc: ...
# block
when: condtion applied to block The longer the block is, the harder it is to see that the I used to put the comment But it's way clearer to rewrite it like this: - name: Named block
when: condtion applied to block
block:
- name: Task 1
etc: ...
- name: Task 2
etc: ... So I'm very happy to see this rule, but I'm still not happy that it was introduced in a minor version causing new failures but that's a separate discussion. |
Beta Was this translation helpful? Give feedback.
-
I am looking at the key-order rule and noticed the when: is located at the top https://ansible-lint.readthedocs.io/rules/key-order/ in the example.
I wanted to clarify what Is the recommended position to put when? Is there an opinion on this? and if not should ansible-lint create an opinion on the positioning of when?
or
Thanks for any guidance
Beta Was this translation helpful? Give feedback.
All reactions