Courseiva

EX294 Manage task execution and roles Practice Question

Exhibit

[root@control ansible]# cat ansible.cfg
[defaults]
host_key_checking = False
inventory = ./inventory
roles_path = ./roles

[inventory]
enable_plugins = host_list, script, auto, yaml, ini, toml

[privilege_escalation]
become = True
become_method = sudo
become_user = root
become_ask_pass = False

[root@control ansible]# cat inventory
[webservers]
web1 ansible_host=192.168.1.10 ansible_user=admin
web2 ansible_host=192.168.1.11 ansible_user=admin

[dbservers]
db1 ansible_host=192.168.1.20 ansible_user=admin

[all:vars]
ansible_python_interpreter=/usr/bin/python3

[root@control ansible]# ansible webservers -m ping
web1 | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python3"
    },
    "changed": false,
    "ping": "pong"
}
web2 | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python3"
    },
    "changed": false,
    "ping": "pong"
}

Refer to the exhibit. The administrator wants to run a playbook that installs a package on all webservers. Which command will use the existing configuration and inventory correctly?

⚠ Common exam trap

The trap is that candidates may think they need to specify the inventory explicitly with '-i' or provide interpreter variables, but the question states 'existing configuration and inventory correctly,' implying the default configuration already handles it.

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-playbook site.yml

The command 'ansible-playbook site.yml' uses the default Ansible configuration file (ansible.cfg) and the default inventory location defined there. If the administrator has already configured the inventory and other settings in ansible.cfg, this command will correctly target the webservers group as defined in the playbook. No extra flags are needed because the existing configuration is assumed to be in place.

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-playbook -e 'ansible_python_interpreter=/usr/bin/python3' site.yml

    Why it's wrong here

    Passing an extra variable with -e does not supply an inventory; the play still relies on the default hosts file, so the webservers group may be unresolved. It is tempting because setting ansible_python_interpreter is a genuine fix for interpreter discovery errors on managed hosts, but that is unrelated to inventory selection here.

  • ✓

    ansible-playbook site.yml

    Why this is correct

    ansible-playbook site.yml runs the playbook using the default ansible.cfg and inventory already present in the working directory, so existing host groupings such as webservers are honoured without extra flags. This matches the requirement to use the existing configuration and inventory correctly.

  • ✗

    ansible webservers -m package -a 'name=httpd state=present'

    Why it's wrong here

    This is an ad-hoc command, not ansible-playbook, so it never runs site.yml and ignores the playbook's tasks entirely. It is tempting because ad-hoc package modules do install software across a host pattern, which is valid for one-off installs without an existing playbook.

  • ✗

    ansible-playbook -i inventory site.yml

    Why it's wrong here

    Specifying -i inventory overrides the configured inventory location, so it only works if that path actually exists and matches the exhibit's configured inventory; otherwise the webservers group is not found. It is tempting because -i is the correct way to point Ansible at an inventory when no default is configured.

About these practice questions

Courseiva writes every EX294 question from scratch — 392 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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.