Courseiva
mediumMultiple ChoiceObjective-mapped

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?

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 'state: replaced' will replace the entire interface configuration with only the provided parameters. This means that any existing configuration on GigabitEthernet0/1 (like IP address, speed, duplex) will be removed and only the description and enabled state will be applied. This is a common pitfall.

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

    The 'replaced' state replaces the entire interface configuration, not just the provided parameters.

  • The playbook will fail because 'enabled' is not a valid parameter for ios_interfaces.

    Why it's wrong here

    'enabled' is a valid parameter in the cisco.ios.ios_interfaces module.

  • The interface will be configured with only the description and enabled state, removing any other existing configuration.

    Why this is correct

    The 'replaced' state replaces the whole interface configuration with the provided values.

  • The playbook will fail because 'state: replaced' requires a 'before' and 'after' state.

    Why it's wrong here

    'replaced' is a valid state that replaces the configuration with the provided one.

About these practice questions

One of 1,175 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 →

How Courseiva writes practice questions · Editorial policy

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 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.