-
Notifications
You must be signed in to change notification settings - Fork 722
Open
Labels
Description
Summary
The configuration mock_roles does not work with roles from collections, i.e. roles with two . characters in their name.
Issue Type
- Bug Report
OS / ENVIRONMENT
Tested in two different environments:
ansible-lint 26.1.1 using ansible-core:2.20.2 ansible-compat:25.12.0 ruamel-yaml:0.19.1 ruamel-yaml-clib:0.2.15Also
ansible-lint 25.8.2 using ansible-core:2.20.0 ansible-compat:25.12.0 ruamel-yaml:0.18.16 ruamel-yaml-clib:0.2.14- ansible installation method: pip, nixpkgs
- ansible-lint installation method: pip, nixpkgs
STEPS TO REPRODUCE
cd $(mktemp -d test-ansible-lint-XXXXXXXX -p '')
cat > .ansible-lint.yml << EOF
---
mock_roles:
- one.two
- one.two.three
EOF
cat > my_playbook.yml << EOF
---
- name: Testing ansible-lint
hosts: all
roles:
- one.two
- one.two.three
EOF
ansible-lintDesired Behavior
Passed: 0 failure(s), 0 warning(s) on 2 files. Last profile that met the validation criteria was 'production'.
Actual Behavior
WARNING Listing 1 violation(s) that are fatal
syntax-check[specific]: the role 'one.two.three' was not found in /tmp/test-ansible-lint-nmW1zPN0/roles:/tmp/test-ansible-lint-nmW1zPN0/.ansible/roles:/home/jenni/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/tmp/test-ansible-lint-nmW1zPN0
my_playbook.yml:5:7
# Rule Violation Summary
1 syntax-check profile:min tags:core,unskippable
Failed: 1 failure(s), 0 warning(s) on 2 files.
Note
Role names with one . work, you can try this by running sed -i.bak '/one.two.three/d' my_playbook.yml followed by ansible-lint
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status