Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
36 lines (26 sloc) 1.12 KB
Some hints about using ansible-lint


Accessing Ansible modules from other repos

In the unlikely case where you would end up with ansible-lint errors caused by the fact that it fails to find some Ansible modules which may not even be located inside your own repository, I provide this hack for you which assures is able to find zuul_return module which is part of zuul Python package.

{% code-tabs %} {% code-tabs-item title=".pre-commit-config.yaml" %}

  - repo:
    rev: v4.1.1a0
      - id: ansible-lint
        files: \.(yaml|yml)$
        # Helps it find zuul_return module on both zuul and on dev environments,
        # Based on
        entry: >
          bash -c 'env ANSIBLE_LIBRARY=`python -c "import os, zuul;
          ansible-lint --force-color -v "$@"'
        exclude: playbooks/legacy
          - zuul

{% endcode-tabs-item %} {% endcode-tabs %}

You can’t perform that action at this time.