Interview Prep/Ansible/Roles, Collections and Galaxy

What is the standard role directory structure?

BeginnerConceptRoles, Collections and Galaxy
Answer
roles/nginx/
  tasks/main.yml       # entry point
  handlers/main.yml
  defaults/main.yml    # overridable variables, lowest precedence
  vars/main.yml        # internal constants, high precedence
  files/               # static files for copy
  templates/           # .j2 files for template
  meta/main.yml        # dependencies, galaxy metadata
  library/ module_utils/   # role-local plugins
  molecule/            # tests

Only tasks/main.yml is required; every other directory is optional. Ansible loads main.yml (or .yaml, .json) from each of them.

All Ansible questions Roadmap: Ansible

More on Roles, Collections and Galaxy