Ansible-lint: Difference between revisions

From DWIKI
Tony (talk | contribs)
mNo edit summary
Tag: wikieditor
Tony (talk | contribs)
Tag: wikieditor
Line 14: Line 14:
==Lines should be no longer than 160 chars==
==Lines should be no longer than 160 chars==
ignore for now?
ignore for now?
==Shells that use pipes should set the pipefail option==
shell: set -o pipefail &&  ...

Revision as of 09:41, 21 September 2023

FAQ

Don't compare to literal True/False

Instead of

when: (foo == 1 and bar == 0) == false

use

when: not (foo == 1 and bar == 0) 

Commands should not change things if nothing needs doing

Sometimes fixed by adding

changed_when: false


Lines should be no longer than 160 chars

ignore for now?


Shells that use pipes should set the pipefail option

shell: set -o pipefail &&  ...