nerdexam
Cisco

200-901 · Question #325

Refer to the exhibit. A network engineer must configure new interfaces on a set of devices and is planning to use an Ansible playbook for the task. All devices support SSH and NETCONF protocol, and…

The correct answer is B. host_vars directory. For Ansible automation with unique variables per device, the host_vars directory is where YAML files containing device-specific variables should be stored.

Infrastructure and Automation

Question

Refer to the exhibit. A network engineer must configure new interfaces on a set of devices and is planning to use an Ansible playbook for the task. All devices support SSH and NETCONF protocol, and the interface variables are unique per device. In which directory are the YAML files including variables hosted to automate the task with the netconf_config module?

Exhibit

200-901 question #325 exhibit

Options

  • Acurrent working directory
  • Bhost_vars directory
  • Cgroup_vars directory
  • Dhome directory

How the community answered

(55 responses)
  • B
    95% (52)
  • C
    4% (2)
  • D
    2% (1)

Why each option

For Ansible automation with unique variables per device, the `host_vars` directory is where YAML files containing device-specific variables should be stored.

Acurrent working directory

The current working directory is not a standard place for Ansible to automatically find host-specific variables.

Bhost_vars directoryCorrect

The `host_vars` directory is specifically designed in Ansible to store variables unique to individual hosts. When variables for devices are distinct and not shared across groups, placing them in YAML files within `host_vars/<hostname>` ensures that each device receives its correct, specific configuration values.

Cgroup_vars directory

The `group_vars` directory is used for variables that apply to all hosts within a defined group, not for variables unique to individual hosts.

Dhome directory

The home directory is a user-specific directory and is not where Ansible expects to find variables for managed hosts.

Concept tested: Ansible variable precedence and host-specific variables

Source: https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#host-and-group-variables

Topics

#Ansible#Variables#Network Automation#Inventory

Community Discussion

No community discussion yet for this question.

Full 200-901 Practice