Courseiva
hardMultiple SelectObjective-mapped

CCNP Practice Question: Which three statements about Ansible roles and…

Which three statements about Ansible roles and directory structure are true? (Choose three.)

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

A role must contain at least a 'tasks' directory with a main.yml file to be functional.

Ansible roles have a predefined directory structure including tasks, handlers, vars, defaults, files, templates, and meta. Roles can be shared via Ansible Galaxy. The 'defaults' directory contains lowest-priority variables. The 'meta' directory defines role dependencies.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • A role must contain at least a 'tasks' directory with a main.yml file to be functional.

    Why this is correct

    Correct because the 'tasks/main.yml' file is the core of a role; it defines the list of tasks to execute.

  • Variables defined in the 'defaults' directory of a role have the highest precedence.

    Why it's wrong here

    Incorrect because 'defaults' variables have the lowest precedence; they are overridden by inventory, playbook, and other variable sources.

  • The 'meta' directory in a role can define dependencies on other roles using the 'dependencies' key.

    Why this is correct

    Correct because the 'meta/main.yml' file can list role dependencies, which are automatically applied when the role is used.

  • Handlers in a role are defined in the 'handlers' directory and are triggered by the 'notify' directive in tasks.

    Why this is correct

    Correct because handlers are special tasks that run only when notified by other tasks via the 'notify' keyword; they are defined in 'handlers/main.yml'.

  • Roles cannot be shared or reused across different Ansible projects.

    Why it's wrong here

    Incorrect because roles are designed for reusability and can be shared via Ansible Galaxy or copied between projects.

About these practice questions

Courseiva writes every 350-401 question from scratch — 1,175 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

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.