Step 5 of #118. The scenarios' converge plays call the roles by FQCN (mortis.kamino.<role>), which only resolves from an ansible_collections/<namespace>/<name> directory, and a checkout is not one, so .ansible-lint listed the five roles in mock_roles and ansible-lint never checked those plays against the real roles. scripts/ansible-lint.sh, which the ansible-lint hook runs in CI and locally, now links the checkout as ansible_collections/<namespace>/<name> in a temporary root (namespace and name read from galaxy.yml), puts that root first on ANSIBLE_COLLECTIONS_PATH and removes it on exit, so ansible-lint reads the checkout itself. Removing mock_roles reproduced five syntax-check[specific] role-not-found errors; with the link the run passes with no warnings, locally and with CI's preset path. A bare ansible-lint, outside the hook, does not get the link; .ansible-lint says so. No image input changes: .pre-commit-config.yaml, requirements and images/** are untouched, so no version bump or second pull request. Closes the last open item of #118. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG
20 lines
867 B
Plaintext
20 lines
867 B
Plaintext
---
|
|
# Same profile as the environment repo. The production profile enforces
|
|
# var-naming[no-role-prefix]: every role variable carries the role name as a prefix.
|
|
profile: production
|
|
|
|
exclude_paths:
|
|
- .gitea
|
|
- .venv
|
|
- apm_modules
|
|
- apm.lock.yaml
|
|
- changelogs
|
|
- images
|
|
|
|
# The collections of the Collection's dependencies (galaxy.yml) are pinned in requirements.yml and
|
|
# resolved offline: the ci image bakes them into /opt/collections and scripts/dev-setup.sh installs
|
|
# them into .ansible/collections, so their modules are linted, not mocked. The Collection's own role
|
|
# names (mortis.kamino.<role>, used by the scenarios) resolve the same way: scripts/ansible-lint.sh,
|
|
# which the hook runs, links the checkout as ansible_collections/mortis/kamino. A bare `ansible-lint`
|
|
# does not do that and reports the role names as not found; run it through the hook.
|