Courseiva
mediumMultiple SelectObjective-mapped

350-401 Practice Question: Which two statements about Ansible inventory and…

Which two statements about Ansible inventory and variables are true? (Choose two.)

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

The 'ansible_host' variable can be used to specify the IP address or FQDN for a managed node.

Group variables can be defined in group_vars/ files or directly in the inventory. Host variables can be set inline in the inventory or in host_vars/. The 'ansible_host' variable overrides the hostname for SSH connection. Variables defined in playbooks override inventory variables. Ansible facts are gathered automatically unless disabled.

Answer analysis

Option-by-option breakdown

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

  • Variables defined in the inventory file override variables defined in group_vars/ for the same group.

    Why it's wrong here

    Incorrect: Variables in group_vars/ have higher precedence than those defined inline in the inventory.

  • The 'ansible_host' variable can be used to specify the IP address or FQDN for a managed node.

    Why this is correct

    Correct: 'ansible_host' overrides the hostname in the inventory for connection purposes.

  • Host variables can be defined in the inventory file using the 'host_vars' directory.

    Why it's wrong here

    Incorrect: Host variables are defined in the host_vars/ directory or inline in the inventory, not in a directory named 'host_vars' inside the inventory file.

  • Group variables can be stored in YAML files under the 'group_vars' directory.

    Why this is correct

    Correct: group_vars/ is a standard directory where group-specific variables are stored in YAML files.

  • Ansible facts are only gathered when the 'gather_facts: no' option is set in the playbook.

    Why it's wrong here

    Incorrect: Facts are gathered by default; setting 'gather_facts: no' disables fact gathering.

About these practice questions

This 350-401 question is part of Courseiva's 1,175-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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.