Ansible Roles & Galaxy Flashcards
6 cards from real Ansible Automation practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 6 Ansible Roles & Galaxy flashcards as text
What command creates a new role scaffold with the standard directory structure?
Answer: ansible-galaxy role init myrole
ansible-galaxy role init generates a standardized role directory with tasks, handlers, defaults, vars, files, templates, and meta folders.
In an Ansible role, which directory holds the default variable values that can be easily overridden?
Answer: defaults/
Variables in defaults/main.yml have the lowest precedence and are designed to be overridden by users of the role.
Which role directory is used to store Jinja2 template files?
Answer: templates/
The templates/ directory holds .j2 Jinja2 template files that are rendered by the template module during role execution.
Which file in a role defines the role's metadata including dependencies?
Answer: meta/main.yml
meta/main.yml contains role metadata such as author, license, supported platforms, and role dependencies.
How do you call a role inside a playbook using the modern recommended syntax?
Answer: roles: [myrole]
The roles: key in a play statically imports roles before any tasks run; it is the standard way to apply roles in a playbook.
Which directory in a role stores static files that can be transferred to managed hosts unchanged?
Answer: files/
The files/ directory contains static files copied to managed hosts using the copy or synchronize modules without any Jinja2 processing.
How this page was made: written with AI tools and published by Nathan Beja, founder of Practice Test Geeks, who is responsible for its content. Exam facts are checked against the official sources listed below. Not reviewed by a subject-matter expert. Editorial policy
Sources & references
Exam facts on this page (fees, format, dates, passing scores) are checked against these official sources; the date is our last check. Editorial policy
- redhat.com — Score release, test delivery, renewal, score validity, exam information · verified Oct 2026
- docs.redhat.com — Fees, exam format, retake policy · verified Oct 2026