hardMultiple Choice
350-401 Practice Question: An Ansible playbook uses the…
An Ansible playbook uses the cisco.nxos.nxos_config module to configure a Nexus switch:
--- - hosts: nxos_switches gather_facts: no connection: network_cli tasks: - name: Configure VLAN cisco.nxos.nxos_config: lines: - vlan 100 - name Test_VLAN parents: vlan 100
What will be the result of this playbook?
⚠ Common exam trap
Many candidates assume the `parents` parameter is optional or that overlapping commands are harmless, but Cisco tests the precise understanding that `parents` defines the configuration context and must not duplicate commands in `lines`.
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 playbook will fail because the 'parents' parameter cannot be the same as the lines.
The `parents` parameter in the `cisco.nxos.nxos_config` module specifies the parent configuration context (e.g., `vlan 100`) under which the `lines` should be applied. When `lines` includes the same command as `parents` (e.g., `vlan 100`), it creates a conflict because the module attempts to enter the parent context and then apply the line again, which is invalid in NX-OS CLI syntax. This results in a playbook failure.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The playbook will successfully create VLAN 100 and set its name to Test_VLAN.
Why it's wrong here
This outcome is impossible because the playbook defines 'parents: vlan 100' while also including 'vlan 100' in the lines list. The module then attempts to nest 'vlan 100' and 'name Test_VLAN' as subcommands beneath a parent block already named 'vlan 100', which is an invalid hierarchy on NX-OS. Consequently, the module returns an error instead of successfully creating the VLAN. For global commands like VLAN creation, the parents parameter should be empty or omitted, or used only to host legitimate subcommands.
- ✓
The playbook will fail because the 'parents' parameter cannot be the same as the lines.
Why this is correct
The module's parents parameter is designed to provide the configuration context under which the lines should be applied. When you set parents to 'vlan 100' and simultaneously include 'vlan 100' in the lines list, the module builds a configuration hierarchy where 'vlan 100' appears as a subcommand of itself. NX-OS rejects this invalid nested structure because a command cannot serve as its own parent. Therefore, the module raises an error and the intended VLAN configuration is never applied.
- ✗
The playbook will fail because 'cisco.nxos.nxos_config' does not support VLAN configuration.
Why it's wrong here
This is not the cause of failure because cisco.nxos.nxos_config is a generic configuration module that can send any arbitrary NX-OS CLI command, including VLAN configuration commands. VLAN configuration is just another set of CLI lines, so the module fully supports it. The actual problem is the invalid use of the parents parameter, not any inherent limitation of the module. The playbook would work perfectly fine if the parents parameter were structured correctly.
- ✗
The playbook will work but only if the Nexus switch runs NX-OS 7.0 or later.
Why it's wrong here
The issue is entirely independent of the NX-OS software version. The invalid use of the parents parameter—setting it to the same value as the lines—produces a structural conflict that will fail identically on any NX-OS release, whether 6.x, 7.0, or later. NX-OS 7.0 did not introduce any changes to VLAN command parsing or configuration nesting that would affect this scenario. Therefore, upgrading or downgrading the NX-OS version would not alter the outcome.
Visual reference
Go deeper
Related to this question
Learn chapter
EIGRP: Basics and Advanced Configuration
Key term
Ansible for Network Automation
Ansible for Network Automation is an open-source tool that allows network engineers to automate the configuration, management, and deployment of network devices like routers and switches using simple text files instead of manual commands.
About these practice questions
Courseiva writes every 350-401 question from scratch — 1,923 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 →
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.