Question 542 of 1,819
AI and Network OperationshardConfigurationObjective-mapped

Quick Answer

The correct answer is the playbook using the ios_config module with the parents parameter set to interface GigabitEthernet0/0 and the lines parameter containing the description command. This is correct because the ios_config module operates in configuration mode, and the parents parameter allows you to enter a specific configuration context—in this case, the interface subconfiguration mode—before applying the lines. On the CCNA 200-301 v2 exam, this tests your understanding of how Ansible interacts with Cisco IOS devices, specifically that interface descriptions are configured under the interface, not globally. A common trap is forgetting the parents parameter, which would apply the description to the global configuration instead, causing a syntax error. Remember the memory tip: "Parents put you in the right place"—just as you need to type interface Gi0/0 before description in the CLI, the parents parameter tells Ansible to enter that sub-mode first.

CCNA AI and Network Operations Practice Question

This 200-301 practice question tests your understanding of ai and network operations. This is a configuration task: choose the command set that satisfies every stated requirement. Small differences — like 'secret' vs 'password' or 'transport input ssh' vs 'all' — change whether the answer is correct. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

You are connected to the console of R1, a Cisco router that is part of a larger network. The network operations team uses Ansible to manage configurations. You need to write an Ansible playbook that configures an interface description on R1. The playbook should use the ios_config module.

Question 1hardConfiguration
Read the full Ansible explanation →

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

--- - name: Configure interface description hosts: R1 gather_facts: no tasks: - name: Add description to Gi0/0 ios_config: lines: - description Link to Core parents: interface GigabitEthernet0/0

The playbook uses the ios_config module to add the description line under the interface configuration. The 'parents' parameter sets the context to 'interface GigabitEthernet0/0'. The playbook must be saved as a .yml file and run with ansible-playbook.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

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

  • --- - name: Configure interface description hosts: R1 gather_facts: no tasks: - name: Add description to Gi0/0 ios_config: lines: - description Link to Core parents: interface GigabitEthernet0/0

    Why this is correct

    This playbook correctly uses the ios_config module with the 'lines' parameter to specify the configuration command and the 'parents' parameter to set the interface context. The YAML syntax is valid, and the playbook can be run with ansible-playbook.

    Related concept

    Read the scenario before looking for a memorised answer.

  • --- - name: Configure interface description hosts: R1 gather_facts: no tasks: - name: Add description to Gi0/0 ios_config: lines: - interface GigabitEthernet0/0 - description Link to Core

    Why it's wrong here

    This is incorrect because the ios_config module does not support entering interface configuration mode by including the 'interface' command in the 'lines' list. The 'parents' parameter must be used to specify the parent configuration context.

  • --- - name: Configure interface description hosts: R1 gather_facts: no tasks: - name: Add description to Gi0/0 ios_command: commands: - configure terminal - interface GigabitEthernet0/0 - description Link to Core

    Why it's wrong here

    This is incorrect because the ios_command module is used for sending exec commands, not for configuration. The ios_config module is specifically designed for configuration changes and ensures idempotency.

  • --- - name: Configure interface description hosts: R1 gather_facts: no tasks: - name: Add description to Gi0/0 ios_config: lines: - description Link to Core parents: GigabitEthernet0/0

    Why it's wrong here

    This is incorrect because the 'parents' parameter requires the full interface configuration command, including the 'interface' keyword. Simply specifying 'GigabitEthernet0/0' is not valid; it must be 'interface GigabitEthernet0/0'.

Option-by-option analysis

Why each answer is right or wrong

Understanding why wrong answers are wrong — and when they would be correct — is what separates a 750 score from a 900. The 200-301 exam frequently reuses these exact scenarios with slightly different constraints.

--- - name: Configure interface description hosts: R1 gather_facts: no tasks: - name: Add description to Gi0/0 ios_config: lines: - description Link to Core parents: interface GigabitEthernet0/0Correct answer

Why this is correct

This playbook correctly uses the ios_config module with the 'lines' parameter to specify the configuration command and the 'parents' parameter to set the interface context. The YAML syntax is valid, and the playbook can be run with ansible-playbook.

--- - name: Configure interface description hosts: R1 gather_facts: no tasks: - name: Add description to Gi0/0 ios_config: lines: - interface GigabitEthernet0/0 - description Link to CoreWrong answer — click to see why

Why this is wrong here

The specific factual error: The 'lines' parameter should only contain the configuration commands to be applied under the parent context, not the parent command itself.

Why candidates choose this

Candidates might think that including the 'interface' command in the lines list would work, similar to how one would type commands in the CLI sequentially.

--- - name: Configure interface description hosts: R1 gather_facts: no tasks: - name: Add description to Gi0/0 ios_command: commands: - configure terminal - interface GigabitEthernet0/0 - description Link to CoreWrong answer — click to see why

Why this is wrong here

The specific factual error: The ios_command module does not handle configuration mode properly and is not intended for configuration tasks; it sends commands and returns output without state management.

Why candidates choose this

Candidates might confuse ios_command with ios_config, thinking that any command can be sent via ios_command, including configuration commands.

--- - name: Configure interface description hosts: R1 gather_facts: no tasks: - name: Add description to Gi0/0 ios_config: lines: - description Link to Core parents: GigabitEthernet0/0Wrong answer — click to see why

Why this is wrong here

The specific factual error: The 'parents' parameter expects the exact command that enters the configuration context, such as 'interface GigabitEthernet0/0', not just the interface name.

Why candidates choose this

Candidates might assume that the 'parents' parameter only needs the interface name, similar to how some other automation tools might accept abbreviated context identifiers.

Analysis generated from the official 200-301blueprint and verified against question context. The “when correct” sections are what AI assistants cite when candidates ask “what’s the difference between these options?”

Common exam traps

Common exam trap: answer the scenario, not the keyword

Many certification questions include familiar terms but test a specific constraint. Read the exact wording before choosing an answer that is generally true but wrong for this case.

Trap categories for this question

  • Keyword trap

    This is incorrect because the 'parents' parameter requires the full interface configuration command, including the 'interface' keyword. Simply specifying 'GigabitEthernet0/0' is not valid; it must be 'interface GigabitEthernet0/0'.

  • Command / output trap

    This is incorrect because the ios_config module does not support entering interface configuration mode by including the 'interface' command in the 'lines' list. The 'parents' parameter must be used to specify the parent configuration context.

Detailed technical explanation

How to think about this question

This question should be treated as a scenario, not a definition check. Identify the problem, the constraint and the best action. Then compare each option against those facts.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.
  • Use explanations to understand the rule behind the answer.

TExam Day Tips

  • Underline the problem statement mentally.
  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A practitioner preparing for the 200-301 exam encounters this exact type of scenario on the job. The correct answer here is not the most general option — it is the best answer for the specific constraint described. Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option. Real exam questions reward reading the full scenario before eliminating options, because the constraint defines which answer fits.

What to study next

Got this wrong? Here's your next step.

Identify which 200-301 exam domain this question belongs to, then review the specific concept being tested. Practise related questions in that domain and focus on understanding why each wrong answer is tempting — not just why the correct answer is right.

Related practice questions

Related 200-301 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free 200-301 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this 200-301 question test?

AI and Network Operations — This question tests AI and Network Operations — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: --- - name: Configure interface description hosts: R1 gather_facts: no tasks: - name: Add description to Gi0/0 ios_config: lines: - description Link to Core parents: interface GigabitEthernet0/0 — The playbook uses the ios_config module to add the description line under the interface configuration. The 'parents' parameter sets the context to 'interface GigabitEthernet0/0'. The playbook must be saved as a .yml file and run with ansible-playbook.

What should I do if I get this 200-301 question wrong?

Identify which 200-301 exam domain this question belongs to, then review the specific concept being tested. Practise related questions in that domain and focus on understanding why each wrong answer is tempting — not just why the correct answer is right.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Keep practising

More 200-301 practice questions

Last reviewed: Jun 7, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This 200-301 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 200-301 exam.