Courseiva

EX294 Manage inventories and credentials Practice Question

You provision a new RHEL 9 control node and create a project directory at /home/devops/ansible. While testing connectivity with `ansible all -m ping`, every host returns UNREACHABLE, yet `ssh` from the shell to those same hosts works without a password. The inventory file at /home/devops/ansible/inventory defines the group `web` with `web1 ansible_host=10.20.30.41`. Which action most directly resolves the failure?

⚠ Common exam trap

The trap here is assuming that working manual SSH guarantees Ansible uses the same username, when Ansible actually defaults to the local account name.

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

✓

Add `ansible_user=devops` to the inventory host entry or run the ad-hoc command with `-u devops`.

Because manual SSH succeeds but Ansible cannot connect, the difference lies in the identity Ansible uses. Ansible defaults to the local account name for remote logins, so when that name differs from the account holding the authorized key, the connection is refused and hosts are marked UNREACHABLE. Defining the correct remote user in inventory or on the command line restores key-based access without altering the transport.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Add `ansible_connection=local` to the inventory host entry.

    Why it's wrong here

    Setting the connection to local makes Ansible execute the ping module on the control node itself and never opens an SSH session to 10.20.30.41. That would mask the authentication problem rather than solve it, and every module would then run against the wrong machine. The task requires managing the remote host, so a local connection is inappropriate.

  • ✗

    Add `ansible_python_interpreter=/usr/bin/python3` to the inventory host entry.

    Why it's wrong here

    The Python interpreter path is discovered after SSH authentication succeeds, so a wrong or missing interpreter produces module errors, not an UNREACHABLE result. Because the failure happens at the connection stage, adjusting the interpreter cannot repair it. This variable matters for managed nodes lacking /usr/bin/python, a different symptom entirely.

  • ✗

    Install the `sshpass` package on the control node.

    Why it's wrong here

    sshpass is only needed when Ansible authenticates with a password instead of a key. The scenario states that interactive ssh already succeeds without a password, proving key-based authentication works, so installing sshpass changes nothing about the failed Ansible connection. The real obstacle is the identity Ansible presents, not the absence of a password helper.

  • ✓

    Add `ansible_user=devops` to the inventory host entry or run the ad-hoc command with `-u devops`.

    Why this is correct

    Ansible defaults to the local username for the remote SSH user unless told otherwise. If the local account differs from the remote account that owns the authorized key, the ping module cannot authenticate and the host is reported UNREACHABLE. Supplying the correct remote user through a host variable or the -u flag restores connectivity, and the inventory already resolves the address correctly.

Visual reference

Client Recursive Resolver Root DNS (13 root servers) TLD DNS (.com, .org, …) Authoritative example.com query IP addr answer

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 →

How Courseiva writes practice questions · Editorial policy

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.