DevOps · Flashcard

What makes a directory a valid Ansible role?

  • AIts subdirectory layout: tasks/, defaults/, handlers/
  • BA galaxy_info block naming the author and licence
  • CA requirements entry in the playbook that uses it
  • DPublication to Ansible Galaxy before its first use

Why this is the answer

A role is a filesystem convention: Ansible looks for the known subdirectories and loads main.yml from each one present. galaxy_info in meta/ is optional metadata for publishing, a requirements file is how you fetch someone else's role, and nothing needs publishing to work locally.

Official docs
Study in Gnoseed →