mediumMultiple Choice
XK0-006 Practice Question: Needs to automate the deployment of a new virtual…
A cloud engineer needs to automate the deployment of a new virtual machine with a specific configuration using Ansible. Which file format is typically used for Ansible playbooks?
⚠ Common exam trap
Many candidates confuse the file format for playbooks (YAML) with other Ansible file types, such as JSON for dynamic inventory or INI for static inventory, leading them to select a technically valid but incorrect format for the specific question context.
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
✓
YAML
Ansible playbooks are written in YAML (YAML Ain't Markup Language) because it is human-readable, supports complex data structures like lists and dictionaries, and is designed for configuration management. YAML's indentation-based syntax aligns with Ansible's declarative approach, allowing tasks, variables, and handlers to be defined cleanly without the overhead of brackets or tags.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
JSON
Why it's wrong here
JSON is valid YAML-compatible data but Ansible playbooks are authored in YAML, not JSON; JSON lacks comments and readable multi-line structure. JSON suits API payloads and Ansible facts output. YAML remains the documented playbook format for defining plays and tasks.
- ✓
YAML
Why this is correct
Ansible playbooks are written in YAML, which satisfies the stem's requirement for automating VM deployment with a specific configuration. YAML's human-readable, indentation-based structure maps directly to Ansible's task, module and variable syntax, letting the engineer declare the desired VM state in a single playbook file.
- ✗
XML
Why it's wrong here
Ansible playbooks are YAML documents; XML is not parsed by Ansible for playbook execution. XML suits configuration files for other tools, such as Maven or .NET project definitions. YAML's indentation-based structure maps directly to Ansible's task, play, and role hierarchy.
- ✗
INI
Why it's wrong here
INI files configure Ansible's inventory and ansible.cfg settings, not playbooks. Playbooks require YAML, whose nested lists and mappings express tasks, handlers, and roles. INI would be the correct format for declaring hosts and groups in an inventory file.
Visual reference
Go deeper
Related to this question
About these practice questions
One of 781 original XK0-006 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 XK0-006 practice question is part of Courseiva's free CompTIA 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 XK0-006 exam.