EX294 Manage inventories and credentials Practice Question
An administrator creates a group named `webservers` in an INI-style inventory and a group named `webservers` in a YAML inventory under the same inventory directory. Both groups define different hosts. What is the result when Ansible loads the inventory?
⚠ Common exam trap
The trap here is assuming that duplicate group names across inventory files cause an error or that one file format overrides another, when membership is actually merged.
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 two group definitions are merged, and the group contains the union of hosts from both files
Ansible merges group membership across all loaded inventory sources. When the same group name appears in an INI file and a YAML file, the group ends up containing the union of hosts from both definitions. There is no duplicate error and no format-based precedence for group membership.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Ansible raises a duplicate group error and refuses to load either inventory
Why it's wrong here
Ansible does not reject duplicate group names across inventory sources. It merges group membership from all parsed sources, so the same group name in two files combines rather than conflicting. This option invents a strict duplicate check that is not part of inventory parsing behavior.
- ✗
Only the YAML definition is used because YAML takes precedence over INI
Why it's wrong here
Ansible has no precedence rule that makes YAML inventory override INI inventory. Both formats are parsed by their respective plugins, and group membership from each is merged. This option assumes a format priority that does not exist in inventory parsing.
- ✓
The two group definitions are merged, and the group contains the union of hosts from both files
Why this is correct
When multiple inventory sources define the same group name, Ansible merges them and the group contains all hosts from every definition. Group membership is additive across sources, so the `webservers` group ends up with the combined host list. This is the expected behavior when an inventory directory contains both INI and YAML files.
- ✗
The group from the first parsed file wins and the second group definition is ignored
Why it's wrong here
Ansible does not discard a later group definition when the name already exists. Membership from both sources is combined, so hosts from both definitions belong to the group. This option describes a first-wins rule that does not apply to group membership merging.
Go deeper
Related to this question
About these practice questions
One of 392 original EX294 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 and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Red Hat exam blueprint
This EX294 practice question is part of Courseiva's free Red Hat 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 EX294 exam.