I have split my custom ansible roles and the ones downloaded from ansible-galaxy into seperate directories (./roles
and ~/.ansible/roles
).
In .ansible.cfg
I have added the following configuration:
[...]
roles_path = ~/.ansible/roles:./roles
[...]
Ansible-lint reads my ansible.cfg
and scans both directories as expected.
Since I just want to lint my own ansible roles, I have added the following line to my .ansible-lint
configuration:
[...]
exclude_paths:
- ~/.ansible/roles
[...]
This unfortunately does not work, ansible-lint still scans both directories.
If I expand the username explictly (e.g. - /root/.ansible/roles
), ansible-lint ignores the directory correctly.
Is it somehow possible to ignore my shared roles directory without using an absolute path (since the user accounts differ between my local machine and the ci server)?