mediumMultiple Choice
CCNP Practice Question: An engineer uses the following Ansible playbook…
An engineer uses the following Ansible playbook to configure an interface on a Cisco IOS-XE device using the cisco.ios.ios_interfaces module:
```yaml --- - name: Configure interface hosts: cisco-routers gather_facts: no tasks: - name: Set interface description cisco.ios.ios_interfaces: config: - name: GigabitEthernet0/1 description: "Uplink to Core"
enabled: true
state: replaced ```
What is the result of running this playbook?
⚠ Common exam trap
350-401 often tests the distinction between Ansible state values (merged vs. replaced vs. overridden), and candidates commonly assume 'replaced' behaves like 'merged' and only adds configuration.
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 interface will be configured with only the description and enabled state, removing any other existing configuration.
The cisco.ios.ios_interfaces module with state: replaced enforces the exact declared configuration on the interface, meaning any parameters not specified in the task are reset to their defaults. Since only 'description' and 'enabled' are declared, all other existing interface settings (such as IP addressing, MTU, speed, duplex, or other L2/L3 attributes) are removed or reverted. This is the defining behavior of 'replaced' versus 'merged' in declarative Ansible network modules.
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 interface will have the description set and all other parameters remain unchanged.
Why it's wrong here
state: replaced overwrites the interface configuration, so parameters not listed in the task are reset to defaults rather than preserved; merged is the state that leaves unspecified settings untouched. The option is tempting because it describes the intuitive behaviour of a partial update, which merged provides.
- ✗
The playbook will fail because 'enabled' is not a valid parameter for ios_interfaces.
Why it's wrong here
'enabled' is a documented boolean parameter of cisco.ios.ios_interfaces, controlling administrative up/down state, so the task runs without error. The objection is tempting because older ios_interface variants used different attribute names, and confusing those legacy modules with the current resource module leads to this assumption.
- ✓
The interface will be configured with only the description and enabled state, removing any other existing configuration.
Why this is correct
With `state: replaced`, the cisco.ios.ios_interfaces module treats the supplied config as the complete desired state for GigabitEthernet0/1, so any existing settings not listed — such as IP addressing, MTU or speed — are removed. Only the description and enabled state remain, satisfying the stem's requirement to strip other configuration.
- ✗
The playbook will fail because 'state: replaced' requires a 'before' and 'after' state.
Why it's wrong here
The ios_interfaces module accepts state: replaced without any before/after parameters; it simply applies the supplied config and removes unspecified settings. The claim is tempting because declarative tools such as Terraform do track prior and desired state, but Ansible resource modules do not require that pairing.
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 →
Same concept, more angles
1 more way this is tested on 350-401
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. An Ansible playbook uses the cisco.ios.ios_l3_interfaces module to configure an IPv4 address on GigabitEthernet0/1: ```yaml --- - name: Configure IPv4 address hosts: cisco-routers gather_facts: no tasks: - name: Set IP address cisco.ios.ios_l3_interfaces: config: - name: GigabitEthernet0/1 ipv4: - address: 10.1.1.1/24 state: merged ``` What is the effect of the 'state: merged' parameter?
medium- A.It replaces the entire L3 configuration on the interface with only the provided address.
- ✓ B.It adds the IP address to the interface, merging with any existing configuration.
- C.It deletes the IP address if it exists.
- D.It only checks the configuration without making changes.
Why B: The 'merged' state adds the provided configuration to the existing configuration without removing any other settings. If the interface already has an IP address, it will be replaced only if the address is different; otherwise, it remains unchanged.
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.