ansible-lint "command not found" in CI
ansible-lint ships as its own pip package, separate from ansible-core. On a runner where it was not installed, the lint step fails with exit code 127 before any rule runs.
What this error means
A ansible-lint step fails with "ansible-lint: command not found" and exit code 127.
Terminal
/home/runner/work/_temp/script.sh: line 1: ansible-lint: command not found
Error: Process completed with exit code 127.Common causes
ansible-lint was never installed
It is not part of ansible-core and not preinstalled on hosted runners; without a pip install step the command is absent.
Installed into a different interpreter
A pip install ran against a Python not on PATH, so the ansible-lint launcher is not resolvable in the lint step.
How to fix it
Install ansible-lint in CI
Install a pinned ansible-lint alongside ansible-core so the command exists.
.github/workflows/ci.yml
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: pip install "ansible-lint==24.9.2" ansible-core
- run: ansible-lintUse the official ansible-lint action
The maintained action installs and runs ansible-lint for you.
.github/workflows/ci.yml
- uses: ansible/ansible-lint@mainHow to prevent it
- Pin ansible-lint in test requirements or use the official action.
- Install it into the same interpreter as ansible-core.
- Cache the pip directory to keep lint steps fast.
Related guides
ansible-lint "syntax-check[specific]" failure in CIFix ansible-lint "syntax-check[specific]" in CI - ansible-lint ran ansible playbook --syntax-check and it fai…
ansible-lint "yaml[line-length]" violation in CIFix ansible-lint "yaml[line-length]" in CI - a line exceeds the configured maximum. Wrap the line or adjust t…
ansible-lint "fqcn[action-core]" violation in CIFix ansible-lint "fqcn[action-core]" in CI - a task uses a short module name (copy, command) instead of the f…