---
name: "ansible-lint"
section: "1"
platform: "linux"
package: "ansible-lint"
version: "25.6.1+really25.2.1-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/ansible-lint"
---

# ansible-lint(1)

lint tool for Ansible playbooks

## NAME

ansible-lint - lint tool for Ansible playbooks

## DESCRIPTION

usage: ansible-lint \[-h\] \[-P \| **-L** \| **-T\]**

- \[-f {brief,full,md,json,codeclimate,quiet,pep8,sarif}\]

  \[--sarif-file SARIF\_FILE\] \[-q\] \[--profile {min,basic,moderate,safety,shared,production}\] \[-p\] \[--project-dir PROJECT\_DIR\] \[-r RULESDIR\] \[-R\] \[-s\] \[--write \[WRITE\_LIST\]\] \[--show-relpath\] \[-t TAGS\] \[-v\] \[-x SKIP\_LIST\] \[--generate-ignore\] \[-w WARN\_LIST\] \[--enable-list ENABLE\_LIST\] \[--nocolor\] \[--force-color\] \[--exclude EXCLUDE\_PATHS \[EXCLUDE\_PATHS ...\]\] \[-c CONFIG\_FILE\] \[-i IGNORE\_FILE\] \[--offline\] \[--version\] \[lintables ...\]

### positional arguments:

- lintables

  One or more files or paths. When missing it will enable auto-detection mode.

### options:

- **-h**, **--help**

  show this help message and exit

- **-P**, **--list-profiles**

  List all profiles, no formatting options available.

- **-L**, **--list-rules**

  List all the rules. For listing rules only the following formats for argument **-f** are supported: {brief, full, md} with 'brief' as default.

- **-T**, **--list-tags**

  List all the tags and the rules they cover. Increase the verbosity level with \`-v\` to include 'opt-in' tag and its rules.

- **-f** {brief,full,md,json,codeclimate,quiet,pep8,sarif}, **--format** {brief,full,md,json,codeclimate,quiet,pep8,sarif}

  stdout formatting, json being an alias for codeclimate. (default: None)

- **--sarif-file** SARIF\_FILE

  SARIF output file

- **-q**

  quieter, reduce verbosity, can be specified twice.

- **--profile** {min,basic,moderate,safety,shared,production}

  Specify which rules profile to be used.

- **-p**, **--parseable**

  parseable output, same as '-f pep8'

- **--project-dir** PROJECT\_DIR

  Location of project/repository, autodetected based on location of configuration file.

- **-r** RULESDIR, **--rules-dir** RULESDIR

  Specify custom rule directories. Add **-R** to keep using embedded rules from */usr/lib/python3/dist-packages/ansiblelint/rules*

- **-R**

  Keep default rules when using **-r**

- **-s**, **--strict**

  Return non-zero exit code on warnings as well as errors

- **--write** \[WRITE\_LIST\]

  Allow ansible-lint to reformat YAML files and run rule transforms (Reformatting YAML files standardizes spacing, quotes, etc. A rule transform can fix or simplify fixing issues identified by that rule). You can limit the effective rule transforms (the 'write\_list') by passing a keywords 'all' or 'none' or a comma separated list of rule ids or rule tags. YAML reformatting happens whenever '--write' or '--write=' is used. '--write' and '--write=all' are equivalent: they allow all transforms to run. The effective list of transforms comes from 'write\_list' in the config file, followed whatever '--write' args are provided on the commandline. '--write=none' resets the list of transforms to allow reformatting YAML without running any of the transforms (ie '--write=none,rule-id' will ignore write\_list in the config file and only run the rule-id transform).

- **--show-relpath**

  Display path relative to CWD

- **-t** TAGS, **--tags** TAGS

  only check rules whose id/tags match these values

- **-v**

  Increase verbosity level (**-vv** for more)

- **-x** SKIP\_LIST, **--skip-list** SKIP\_LIST

  only check rules whose id/tags do not match these values. e.g: **--skip-list**=*name*,run-once

- **--generate-ignore**

  Generate a text file '.ansible-lint-ignore' that ignores all found violations. Each line contains filename and rule id separated by a space.

- **-w** WARN\_LIST, **--warn-list** WARN\_LIST

  only warn about these rules, unless overridden in config file. Current version default value is: experimental, jinja\[spacing\], fqcn\[deep\]

- **--enable-list** ENABLE\_LIST

  activate optional rules by their tag name

- **--nocolor**

  disable colored output, same as NO\_COLOR=1

- **--force-color**

  Force colored output, same as FORCE\_COLOR=1

- **--exclude** EXCLUDE\_PATHS \[EXCLUDE\_PATHS ...\]

  path to directories or files to skip. This option is repeatable.

- **-c** CONFIG\_FILE, **--config-file** CONFIG\_FILE

  Specify configuration file to use. By default it will look for '.ansible-lint', '.config/ansible-lint.yml', or '.config/ansible-lint.yaml'

- **-i** IGNORE\_FILE, **--ignore-file** IGNORE\_FILE

  Specify ignore file to use. By default it will look for '.ansible-lint-ignore' or '.config/ansible-lintignore.txt'

- **--offline**

  Disable installation of requirements.yml and schema refreshing

**--version**
