Interview Prep/Ansible/Roles, Collections and Galaxy

Where does Ansible look for roles?

BeginnerConceptRoles, Collections and Galaxy
Answer

In order: the roles/ directory next to the playbook, the roles_path setting (ANSIBLE_ROLES_PATH; defaults include ~/.ansible/roles and /etc/ansible/roles), and the directory of the playbook itself. Collection roles are referenced by FQCN: role: myorg.platform.nginx.

[defaults]
roles_path = ./roles:~/.ansible/roles

ansible-galaxy role list shows what is installed and where.

All Ansible questions Roadmap: Ansible

More on Roles, Collections and Galaxy