In a collection, one role can import another role just fine. And a playbook inside that collection can also call that role without problem. However, if a custom configuration file path is specified AND there is a playbook importing that role, then the playbook fails lint because it cannot locate the included roles.
When the custom configuration path is passed to listing the roles, they succeed. And when the configuration path is omitted on the playbook, lint succeeds.
I have created a minimal reproducer here, including all four combinations of the arguments.
Issue Type
Bug Report
ansible installation method: pip
ansible-lint installation method: pip
OS / ENVIRONMENT
All
STEPS TO REPRODUCE
See Github Actions job in my minimal reproducer repo
Desired Behavior
Specifying a custom configuration file should not break linting of collection based playbooks
Actual Behavior
Ansible lint errors with unknown role when a plsybook inside a collection calls a role from the same collection and a custom ansible-lint config file path is specified on the command line.
Summary
In a collection, one role can import another role just fine. And a playbook inside that collection can also call that role without problem. However, if a custom configuration file path is specified AND there is a playbook importing that role, then the playbook fails lint because it cannot locate the included roles.
When the custom configuration path is passed to listing the roles, they succeed. And when the configuration path is omitted on the playbook, lint succeeds.
I have created a minimal reproducer here, including all four combinations of the arguments.
Issue Type
Bug Report
ansible installation method: pip
ansible-lint installation method: pip
OS / ENVIRONMENT
All
STEPS TO REPRODUCE
See Github Actions job in my minimal reproducer repo
Desired Behavior
Specifying a custom configuration file should not break linting of collection based playbooks
Actual Behavior
Ansible lint errors with unknown role when a plsybook inside a collection calls a role from the same collection and a custom ansible-lint config file path is specified on the command line.