1
0
Fork 0
mirror of https://github.com/ansible/ansible-lint.git synced 2026-01-07 15:27:10 +01:00
ansible-lint checks playbooks for practices and behavior that could potentially be improved and can fix some of the most common ones for you https://ansible.readthedocs.io/projects/lint/
Find a file
2026-01-07 13:19:49 +00:00
.config fix: retire -p/--parseable option (#4884) 2026-01-05 18:05:26 +00:00
.github chore(deps): update all dependencies (#4852) 2025-12-02 11:21:59 -05:00
.sonarlint chore: replace prettier with biome (#4765) 2025-09-12 17:14:04 -04:00
.vscode chore: replace prettier with biome (#4765) 2025-09-12 17:14:04 -04:00
collections/ansible_collections/local/testcollection Address too many values to unpack when there's subdirectories for roles (#4566) 2025-06-17 12:33:14 +01:00
docs fix: update documentation to clarify requirement to run from project … (#4885) 2026-01-06 10:35:37 +00:00
examples fix: allow valid tabs in lineinfile nested in blocks (#4719) (#4881) 2026-01-06 10:36:14 +00:00
plugins/modules Pyright type fixes (partial) (#4411) 2024-11-16 14:47:06 +00:00
src/ansiblelint fix: anchor kind discovery to project root (#4763) (#4889) 2026-01-07 13:19:49 +00:00
test fix: anchor kind discovery to project root (#4763) (#4889) 2026-01-07 13:19:49 +00:00
tools chore(deps): update all dependencies (#4817) 2025-10-29 10:08:55 -04:00
.ansible-lint fix: retire -p/--parseable option (#4884) 2026-01-05 18:05:26 +00:00
.ansible-lint-ignore Migrate RTD URLs to docs.ansible.com (#4842) 2025-11-19 14:08:09 -07:00
.darglint Some linting fixes (#2766) 2022-12-02 16:47:31 +00:00
.git_archival.txt Fix github archives metadata (#2914) 2023-01-18 16:53:18 +00:00
.gitattributes Mark png files as binary 2020-04-17 16:30:30 +02:00
.gitignore Reapply "fix: adopt uv.lock and dependency-groups (#4757)" (#4761) 2025-09-09 17:23:44 -04:00
.gitmodules Revert ansible-compat vendoring (#3478) 2023-05-22 14:38:45 +01:00
.packit.yaml packit: reformat, remove deprecated syntax and try merge queue (#4639) 2025-07-04 16:18:44 +01:00
.pre-commit-config.yaml fix: retire -p/--parseable option (#4884) 2026-01-05 18:05:26 +00:00
.pre-commit-hooks.yaml Fix typos (#4814) 2025-10-10 16:33:32 -04:00
.prettierignore Normalize format of non-test yaml files (#1921) 2022-02-17 13:41:23 -06:00
.prettierrc.yaml Assimilate schemas project (#2769) 2022-12-02 22:32:36 +00:00
.readthedocs.yml Reapply "fix: adopt uv.lock and dependency-groups (#4757)" (#4761) 2025-09-09 17:23:44 -04:00
.vault_pass Refactor use of app instance (#4478) 2025-01-20 09:03:12 +05:30
.yamllint Prevent execution with incompatible yamllint configuration (#4139) 2024-05-07 15:26:27 +01:00
action.yml feat(action): Allow users to override python_version (#4829) 2025-12-10 11:52:40 +00:00
ansible.cfg Refactor use of app instance (#4478) 2025-01-20 09:03:12 +05:30
biome.json chore: replace prettier with biome (#4765) 2025-09-12 17:14:04 -04:00
codecov.yml Remove patch report from codecov (#4671) 2025-06-30 13:22:21 +00:00
conftest.py Enable testing with python 3.14 (#4637) 2025-06-25 08:04:28 +00:00
COPYING Clarify GPLv3 license of the distribution (#1882) 2022-02-14 16:02:38 +00:00
cspell.config.yaml Reapply "fix: adopt uv.lock and dependency-groups (#4757)" (#4761) 2025-09-09 17:23:44 -04:00
DCO_1_1.md Enable prettier for all supported formats (#1925) 2022-02-17 21:01:54 +00:00
mkdocs.yml Migrate RTD URLs to docs.ansible.com (#4842) 2025-11-19 14:08:09 -07:00
package-lock.json chore(deps): update all dependencies (#4863) 2025-12-10 11:51:29 +00:00
package.json Remove dead code and prevent regressions (#4425) 2024-11-26 10:07:13 +00:00
playbook.yml Improve logic of find_children (#4161) 2024-06-04 16:17:10 +01:00
pyproject.toml fix: avoid use of pathspec 1.0.0 until yamllint is updated (#4887) 2026-01-06 11:58:50 +00:00
README.md feat(action): Allow users to override python_version (#4829) 2025-12-10 11:52:40 +00:00
renovate.json chore: Remove cffi, importlib-metadata, reduce core lower bound (#4860) 2025-12-02 07:14:43 -08:00
requirements.yml Refactor types for future ansible-core compatibility (#4557) 2025-03-24 18:28:25 +05:30
sonar-project.properties Update sonar-project.properties (#4815) 2025-10-14 14:13:25 -04:00
uv.lock fix: avoid use of pathspec 1.0.0 until yamllint is updated (#4887) 2026-01-06 11:58:50 +00:00

PyPI version Ansible-lint rules explanation Discussions pre-commit

Ansible-lint

ansible-lint checks playbooks for practices and behavior that could potentially be improved. As a community-backed project ansible-lint supports only the last two major versions of Ansible.

Visit the Ansible Lint docs site

Using ansible-lint as a GitHub Action

This action allows you to run ansible-lint on your codebase without having to install it yourself.

# .github/workflows/ansible-lint.yml
name: ansible-lint
on:
  pull_request:
    branches: ["main", "stable", "release/v*"]
jobs:
  build:
    name: Ansible Lint # Naming the build is important to use it as a status check
    runs-on: ubuntu-24.04
    steps:
      - uses: actions/checkout@v4
      - name: Run ansible-lint
        uses: ansible/ansible-lint@main # or vX.X.X version
        # optional (see below):
        with:
          args: ""
          gh_action_ref: "<version - e.g. `v25.5.0`>" # Not recommended for non-composite action use
          setup_python: "true"
          python_version: "3.14"
          working_directory: ""
          requirements_file: ""

By default, the workflow uses ansible-lint installed from main. For production or stable workflows, it is recommended to specify a particular release tag (in format v.X.X.X).

All the arguments are optional:

  • args: Arguments to be passed to ansible-lint command.
  • gh_action_ref: The git branch, tag, or commit to use for ansible-lint. Not recommended for standard use - only use with composite actions where GH_ACTION_REF is set to the parent action version.
  • requirements_file: Path to the requirements.yml file to install role and collection dependencies.
  • setup_python: If python should be installed. Default is true.
  • python_version: The version of python to install. Default is 3.14.
  • working_directory: The directory where to run ansible-lint from. Default is github.workspace. Needed if you want to lint only a subset of your repository.

For more details, see ansible-lint-action.

Communication

Refer to the Talk to us section of the Contributing guide to find out how to get in touch with us.

You can also find more information in the Ansible communication guide.

Contributing

Please read Contribution guidelines if you wish to contribute.

Code of Conduct

Please see the Ansible Community Code of Conduct.

Licensing

The ansible-lint project is distributed as GPLv3 due to use of GPLv3 runtime dependencies, like ansible and yamllint.

For historical reasons, its own code-base remains licensed under a more liberal MIT license and any contributions made are accepted as being made under original MIT license.

Authors

ansible-lint was created by Will Thames and is now maintained as part of the Ansible by Red Hat project.