Which `ansible-lint` rules catch the most real production problems?
IntermediateProductionTesting, CI/CD and Quality
Answer
From experience, these find actual bugs rather than style issues:
| Rule | Why it matters |
|---|---|
no-changed-when |
Command tasks always report changed, breaking idempotence and handler logic |
risky-file-permissions |
Files created without mode get umask-dependent permissions |
fqcn |
Short module names can resolve to a different collection than you expect |
no-handler |
when: result.changed instead of a handler, which misses restarts on re-runs |
package-latest |
state: latest silently upgrades packages in production |
risky-shell-pipe |
Pipes hide failures without set -o pipefail |
jinja[invalid], yaml[truthy] |
Broken templates and yes/no surprises |
Style rules (name[casing], line length) keep the code readable, but the list above is what we never put in skip_list.
More on Testing, CI/CD and Quality
What does a testing pyramid look like for Ansible code?BeginnerHow do you roll out `ansible-lint` profiles across a team without blocking everyone?IntermediateWhen do you use `skip_list`, `warn_list` and `# noqa`?IntermediateHow do you set up pre-commit hooks for an Ansible repo?BeginnerHow is a Molecule scenario laid out, and what does `molecule test` actually run?IntermediateDocker, Podman or real VMs as the Molecule driver: how do you choose?Advanced