← All Ansible Automation Flashcard Decks

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
  1. How are role dependencies defined so they are automatically executed before the parent role?

    Answer: In meta/main.yml under the 'dependencies' key

    Role dependencies listed under 'dependencies' in meta/main.yml are automatically resolved and executed before the role that declares them.

  2. What is the difference between 'include_role' and 'import_role' in Ansible?

    Answer: include_role is dynamic (evaluated at runtime); import_role is static (evaluated at parse time)

    import_role is statically processed before playbook execution begins, while include_role is dynamically loaded during runtime allowing conditional inclusion.

  3. What variable file in a role takes higher precedence than defaults/main.yml?

    Answer: vars/main.yml

    vars/main.yml has higher precedence than defaults/main.yml and is intended for internal role variables that should not be overridden.

  4. How do you pass a variable to a role when including it in a playbook?

    Answer: Under the role entry using 'vars:' or as key-value pairs inline

    You can pass role-specific variables inline using key-value pairs or a vars: block under the role entry in the roles list.

  5. What naming convention must a Galaxy role follow for its namespace and role name?

    Answer: namespace.role_name using only letters, numbers, and underscores

    Galaxy roles use the format namespace.role_name where both parts contain only alphanumeric characters and underscores.

  6. Which file at the root of an Ansible Collection defines its namespace, name, and version?

    Answer: galaxy.yml

    galaxy.yml at the collection root defines the namespace, name, version, description, and dependencies of the collection.

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

  1. redhat.com — Score release, test delivery, renewal, score validity, exam information · verified Oct 2026
  2. docs.redhat.com — Fees, exam format, retake policy · verified Oct 2026