OnCallReady

Commands

ansible-lint - lint tool for Ansible playbooks, roles and collections

ansible-lint [--profile PROFILE] [-p] [-x SKIP] [-w WARN] [lintables ...]

Options you will use

--profile {min,basic,moderate,safety,shared,production}
Specify which rules profile to be used.
-p, --parseable
Parseable output (pep8 format: file:line: rule: message).
-x, --skip-list SKIP_LIST
Only check rules whose id/tags do not match these values.
-w, --warn-list WARN_LIST
Only warn about these rules (default: experimental, jinja[spacing], fqcn[deep]).
-L, --list-rules
List all the rules.
--offline
Disable installation of requirements.yml and schema refreshing.
--version
Show the version and the ansible-core it uses.

Examples

$ ansible-lint

the whole project, auto-detected

$ ansible-lint site.yml

one playbook

$ ansible-lint --profile production

the strictest profile

$ ansible-lint -p

one line per violation (for CI annotations)

Gotchas

Taught in

Try ansible-lint in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.