Skip to content

ansible-lint checks playbooks for practices and behavior that could potentially be improved and can fix some of the most common ones for you

License

Notifications You must be signed in to change notification settings

ansible/ansible-lint

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date
Mar 19, 2025
Mar 17, 2025
Dec 4, 2024
Mar 17, 2025
Dec 11, 2024
Jan 27, 2025
Feb 18, 2025
Nov 16, 2024
Mar 19, 2025
Mar 19, 2025
Dec 2, 2024
Jan 19, 2025
Dec 15, 2023
Dec 2, 2022
Jan 18, 2023
Apr 17, 2020
Jan 30, 2025
May 22, 2023
Feb 12, 2025
Mar 17, 2025
Feb 5, 2025
Feb 17, 2022
Dec 2, 2022
Dec 3, 2024
Jul 24, 2024
Feb 3, 2025
Jan 20, 2025
May 7, 2024
Feb 14, 2022
Feb 17, 2022
Dec 3, 2024
Jan 20, 2025
Jan 20, 2025
Feb 8, 2024
Nov 22, 2024
Mar 17, 2025
Mar 17, 2025
Nov 26, 2024
Nov 26, 2024
Jun 4, 2024
Mar 19, 2025
May 13, 2024
Mar 17, 2025

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
        # optional (see below):
        with:
          args: ""
          setup_python: "true"
          working_directory: ""
          requirements_file: ""

All the arguments are optional and most users should not need them:

  • args: Arguments to be passed to ansible-lint command.
  • setup_python: If python should be installed. Default is true.
  • working_directory: The directory where to run ansible-lint from. Default is github.workspace. That might be needed if you want to lint only a subset of your repository.
  • requirements_file: Path to the requirements.yml file to install role and collection dependencies.

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.