Let's say your playbook wants to use the "foo" role.
---
- hosts: all
roles:
- foo
By default, roles_path in ansible.cfg is commented out.
# roles_path = /usr/local/roles
When commented out, Ansible will search the following directories for the "foo" role:
Let's say you define some other roles_path in ansible.cfg.
roles_path = /usr/local/ansible/roles
Now Ansible will search the following directories for the "foo" role:
It is noteworthy that you have a role that resides in some other directory, say /usr/local/testing/roles, the role can be used by including the absolute path to the role in your playbook.
---
- hosts: all
roles:
- /usr/local/testing/roles/foo