hardMultiple Select
350-401 Practice Question: Which three statements about Ansible playbooks…
Which three statements about Ansible playbooks and roles are true? (Choose three.)
⚠ Common exam trap
Watch out — candidates often confuse 'import_role' (static, parse-time) with 'include_role' (dynamic, runtime), and reversing the precedence of 'defaults' versus 'vars' in a role — candidates often assume defaults are authoritative when they are actually the weakest.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Roles in Ansible use a standardized directory structure that includes 'tasks', 'handlers', 'vars', 'defaults', and 'meta'.
Option A is correct because Ansible roles follow a standardized directory layout containing subdirectories such as tasks, handlers, vars, defaults, meta, files, and templates, which allows roles to be reused and shared consistently. Option C is correct because handlers are tasks triggered only via the notify directive, and Ansible runs each notified handler only once at the end of a play, even if multiple tasks notify it. Option E is correct because the meta directory holds main.yml, where role dependencies are declared under the dependencies key, and it can also define galaxy metadata. Option B is incorrect because import_role is a static import processed at playbook parsing time, whereas include_role is the module that includes a role dynamically during execution. Option D is incorrect because variables in a role's defaults directory have the lowest precedence among role variables, not the highest; vars files and inventory or play-level variables override them.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Roles in Ansible use a standardized directory structure that includes 'tasks', 'handlers', 'vars', 'defaults', and 'meta'.
Why this is correct
Ansible roles enforce a fixed directory layout — tasks, handlers, vars, defaults, meta, templates and files — so content is discovered automatically by convention rather than declared in the playbook, enabling reuse and clean separation of variables from defaults.
- ✗
The 'import_role' module includes a role dynamically during play execution.
Why it's wrong here
The import_role module parses roles statically at playbook parse time, so it cannot include a role dynamically during execution. It is tempting because import_role and include_role look interchangeable, but dynamic inclusion is performed by include_role, which resolves the role at runtime.
- ✓
Handlers are special tasks that run only when notified by other tasks, and they run only once even if notified multiple times.
Why this is correct
Handlers are queued by the notify directive and executed at the end of the play, and Ansible deduplicates the queue so a handler notified by several tasks still runs exactly once, regardless of how many times it was triggered.
- ✗
Variables defined in the 'defaults' directory of a role have the highest precedence.
Why it's wrong here
Variables in a role's defaults directory carry the lowest precedence, overridden by inventory, play, and role vars. It is tempting because defaults are role-specific and always available, but that availability reflects fallback values, not priority; the highest precedence belongs to extra vars passed at runtime.
- ✓
The 'meta' directory in a role is used to define role dependencies.
Why this is correct
The meta directory's main.yml uses the dependencies key to declare other roles that must execute first, so Ansible resolves and runs them automatically. This satisfies the question's requirement that role dependencies are defined within the role itself.
About these practice questions
One of 1,923 original 350-401 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Cisco exam blueprint
This 350-401 practice question is part of Courseiva's free Cisco certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 350-401 exam.