EX294 Manage inventories and credentials Practice Question
You run 'ansible-playbook -i inventory site.yml' and notice that a host defined in the inventory file is not targeted by a play with 'hosts: all'. The inventory file contains a group named 'ungrouped' with several hosts and a group named 'all_servers' with the same hosts. Which command most directly reveals whether Ansible is parsing the intended inventory source and listing that host under the expected groups?
⚠ Common exam trap
The trap here is reaching for connectivity tests or configuration dumps when the issue is inventory parsing, whereas ansible-inventory directly exposes the parsed inventory structure.
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
✓
ansible-inventory -i inventory --list
The ansible-inventory --list command is designed to parse an inventory source and emit the resulting groups, hosts, and variables as JSON. It is the definitive tool for confirming how Ansible interprets an inventory file, including group membership and host listing.
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-config dump --only-changed
Why it's wrong here
This command displays changed Ansible configuration settings, such as inventory paths or defaults. It does not list inventory contents or group memberships, so it cannot confirm whether the host is parsed into the expected groups. It is useful for configuration troubleshooting, not inventory verification.
- ✓
ansible-inventory -i inventory --list
Why this is correct
The ansible-inventory --list command parses the specified inventory and outputs a JSON representation of all groups and hosts, showing exactly which groups each host belongs to. It confirms whether the host is present and under which group names, making it the most direct diagnostic for inventory parsing issues.
- ✗
ansible all -i inventory -m ping
Why it's wrong here
The ping module tests SSH connectivity to hosts, not inventory structure. It would show whether hosts are reachable but would not explain why a play using 'hosts: all' skipped a host, because the problem is group membership or inventory parsing, not network reachability.
- ✗
ansible-doc -t inventory -l
Why it's wrong here
The ansible-doc command lists available inventory plugins and their documentation. It does not read or display your actual inventory file contents, so it cannot show whether the host is present or which groups it belongs to. It is used for plugin discovery, not inventory validation.
Go deeper
Related to this question
About these practice questions
This EX294 question is part of Courseiva's 392-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. 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.