Skip to content

Commit 2e53e0d

Browse files
committed
Explain why ansible may need to be added as a dependency for ansible-lint
On its own ansible-lint does not pull in ansible, only ansible-core. Therefore, if an Ansible module lives in ansible instead of ansible-core, the linter will complain that the module is unknown. In these cases it is necessary to add the ansible package itself as an additional dependency, with the same pinning as is done in requirements-test.txt of cisagov/skeleton-ansible-role.
1 parent c74e5db commit 2e53e0d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.pre-commit-config.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,14 @@ repos:
156156
hooks:
157157
- id: ansible-lint
158158
additional_dependencies:
159+
# On its own ansible-lint does not pull in ansible, only
160+
# ansible-core. Therefore, if an Ansible module lives in
161+
# ansible instead of ansible-core, the linter will complain
162+
# that the module is unknown. In these cases it is
163+
# necessary to add the ansible package itself as an
164+
# additional dependency, with the same pinning as is done in
165+
# requirements-test.txt of cisagov/skeleton-ansible-role.
166+
# - ansible>=8,<10
159167
# ansible-core 2.16.3 through 2.16.6 suffer from the bug
160168
# discussed in ansible/ansible#82702, which breaks any
161169
# symlinked files in vars, tasks, etc. for any Ansible role

0 commit comments

Comments
 (0)