mediumMultiple ChoiceObjective-mapped
200-901 Practice Question: An Ansible playbook fails with the error:…
An Ansible playbook fails with the error: "mapping values are not allowed here". The relevant YAML snippet is: --- - name: Configure interface ios_config: lines: - ip address 10.0.0.1 255.255.255.0 parents: interface GigabitEthernet0/1 What is the most likely cause of this error?
⚠ Common exam trap
Cisco often tests YAML indentation rules by presenting a snippet where `parents:` is incorrectly indented under `lines:`, leading candidates to mistakenly focus on module requirements or quoting instead of the structural YAML error.
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 indentation of `parents:` is incorrect relative to `lines:`
The error 'mapping values are not allowed here' occurs in YAML when a key-value pair is incorrectly indented relative to its parent. In this snippet, `parents:` is indented at the same level as `lines:`, but it should be a sibling of `lines:` under the same dictionary key. The correct indentation requires `parents:` to be aligned with `lines:` (both at the same indentation level under `ios_config:`), but the error suggests that `parents:` is placed where YAML expects a scalar value, breaking the mapping structure.
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 indentation of `parents:` is incorrect relative to `lines:`
Why this is correct
In YAML, keys under the same mapping must have the same indentation; `parents:` seems misaligned.
- ✗
The `ios_config` module requires a provider statement
Why it's wrong here
Missing provider would cause a different error, not this YAML error.
- ✗
The `lines:` item should be a list of strings
Why it's wrong here
The snippet shows a list already; that is not the issue.
- ✗
The `parents:` value must be enclosed in quotes
Why it's wrong here
Quotes are not mandatory for simple strings in YAML.
Go deeper
Related to this question
About these practice questions
One of 989 original 200-901 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 →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 200-901 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-901 exam.