fix(dev): run ansible-lint against the clone's pinned collections from any shell
Build / build (pull_request) Successful in 12s
Lint / lint (pull_request) Successful in 43s
Molecule / molecule (pull_request) Failing after 49s

The hook scripts written by dev-setup.sh exported ANSIBLE_HOME and ANSIBLE_COLLECTIONS_PATH, so only a hook run through git commit saw the pinned collections; a bare pre-commit run fell back to the control host's ~/.ansible, the drift #118 removes. The ansible-lint hook now runs scripts/ansible-lint.sh, which uses .ansible/collections of the clone when ANSIBLE_COLLECTIONS_PATH is unset, fails with the fix when they are missing, and leaves a preset path (CI's /opt/collections) alone. dev-setup.sh keeps installing the collections and no longer edits the hook scripts beyond the PATH block it always wrote.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG
This commit is contained in:
Defame1297andClaude Sonnet 5.5 committed 2026-11-14 14:14:37 +00:00
1 parent 42ad8de88f
commit bdb34cf98e
7 files changed
+123 -53

No files matched your search

+1 -1
View File
@@ -86,7 +86,7 @@ repos:
- id: ansible-lint
name: ansible-lint
description: ansible-lint production profile, offline
entry: ansible-lint --offline --nocolor
entry: scripts/ansible-lint.sh
language: system
files: ^(roles/|plugins/|meta/|galaxy\.yml$|requirements\.yml$|\.ansible-lint$|\.yamllint$)
stages: ['pre-commit']