Courseiva

EX294 · domain

Manage task execution and roles

This domain covers running plays predictably across managed hosts: controlling where tasks land with hosts, serial, and delegation, plus installing and consuming roles from Galaxy, Git, and local paths via requirements.yml. EX294 tests it through hands-on tasks: writing playbooks and roles, running check mode, and fixing failures without breaking idempotency.

60 questions19 easy20 medium21 hard

Focused practice

Practice Manage task execution and roles questions

Scored sessions drawing only from this domain — pick a length below.

Start 20-question practice test →

What this domain covers

What to know about Manage task execution and roles

Install and reference roles correctly from Galaxy, Git, and local paths, and control task placement across hosts with hosts, serial, and delegation. The key skill is keeping every task idempotent so check mode passes and reruns report no unexpected changes.

Using ansible-galaxy install -r requirements.yml to pull roles from Galaxy, Git, and local paths

Applying hosts, serial, and run_once to control which managed hosts execute each task

Installing roles into the roles directory relative to ansible.cfg and the playbook

Running ansible-playbook --check and interpreting changed versus failed task output

Watch out for

Common Manage task execution and roles exam traps

  • ▸Assuming roles install into the current directory instead of the roles_path configured in ansible.cfg or the playbook-relative roles directory
  • ▸Using ignore_errors or changed_when to hide check-mode failures instead of fixing the underlying non-idempotent task
  • ▸Forgetting that requirements.yml entries need correct src, scm, and name fields for Git versus Galaxy sources

Question index

All Manage task execution and roles questions (60)

Click any question to see the full explanation, or start a practice session above.

1

An administrator runs a playbook with the serial keyword set to 2. The playbook targets 6 hosts and contains a task that runs a rolling update. During execution, the administrator notices that the task is executed on only 2 hosts at a time, but the playbook waits for all tasks to complete on those 2 hosts before moving to the next 2. What is the primary effect of the serial keyword in this scenario?

Medium
2

An administrator is designing a role that needs to execute a set of tasks conditionally based on whether a package is installed. Which approach is best practice?

Hard
3

A team is writing an Ansible role to configure a web server. They want to include default variables that can be easily overridden by playbook variables. Which directory and file should they use to define these variables?

Medium
4

An administrator wants to run a specific set of tasks only on hosts that are members of the 'webservers' group. Which Ansible construct should be used to conditionally execute those tasks based on group membership?

Easy
5

An administrator wants to run a playbook that executes tasks in parallel across multiple hosts but wants to limit the number of simultaneous hosts to 5. Which directive should be set?

Medium
6

Refer to the exhibit. An administrator runs the playbook but the wait_for task fails. What is the most likely cause?

Hard
7

Match each systemd unit type to its description.

Medium
8

An administrator is debugging a playbook that uses multiple roles and wants to limit execution to a specific set of tasks. Which three methods can be used to filter task execution? (Choose three.)

Hard
9

A playbook includes a long-running task that should not block the rest of the playbook. The administrator wants to start the task and later check its status. Which method should be used?

Hard
10

An administrator is writing a role where a task should only execute when the variable `web_package` is defined and its value is `httpd`. The role must not fail if the variable is undefined. Which task condition is correct?

Medium
11

Which two statements are true regarding Ansible roles? (Choose two.)

Easy
12

An administrator needs to ensure that a set of tasks runs only when a specific condition is met, and that the tasks are skipped without error otherwise. The condition depends on a variable that may be undefined. Which TWO approaches will safely evaluate the condition without causing an undefined variable error? (Choose two.)

Hard
13

Which TWO statements about Ansible role defaults are true?

Hard
14

An Ansible playbook fails intermittently due to a service not starting in time. The administrator wants to configure a task to retry until the service confirms it is running. Which Ansible feature should be used?

Hard
15

An administrator has a requirements.yml file specifying roles from multiple sources: a public Galaxy server, a private Git repository, and a local path. They want to install all roles into the roles directory of the current project. Which command will achieve this?

Hard
16

What is the purpose of the 'meta: flush_handlers' task?

Easy
17

What is the purpose of the 'vars' keyword under the httpd role inclusion?

Easy
18

An administrator wants to define role dependencies. In which file should they place the dependencies declaration?

Hard
19

An administrator is using a role that includes a task file conditionally with 'include_tasks' inside a loop. The task file contains a handler notification. The administrator notices that the handler is not being triggered for each iteration. What is the most likely reason?

Hard
20

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?

Medium
21

An administrator maintains a role named 'webserver' that is used by several teams. The role must run a handler named 'restart httpd' after a configuration file is changed, but only when the role is included with a variable 'notify_handler' set to true. The role's tasks/main.yml currently has a task that copies httpd.conf with 'notify: restart httpd'. Which change should the administrator make in the role to ensure the handler is notified only when 'notify_handler' is true?

Medium
22

Which directive in an Ansible playbook ensures that a task runs only on the first host in a batch, and results are applied to all hosts?

Easy
23

An administrator is building a role whose task list must run a platform-specific set of tasks: one file for Red Hat Enterprise Linux hosts and another for Debian hosts, with the choice made at runtime based on gathered facts. The role must remain readable and avoid loading the wrong file even partially. Which approach should the administrator use?

Hard
24

A team develops a custom Ansible role 'webserver' that depends on another role 'common'. They want to ensure that when 'webserver' is used, 'common' is automatically installed from the same Galaxy server. Which approach should they use?

Medium
25

An administrator is using a role named 'app' that contains a task file 'install.yml' and a handler 'restart app'. The role is included in a playbook with 'include_role' and a variable 'app_version' set to '2.0'. The task file 'install.yml' includes a task that notifies the handler. During execution, the handler runs immediately after the task, before other tasks in the play. Which action should the administrator take to ensure the handler runs only at the end of the play?

Hard
26

Which TWO of the following statements about Ansible roles are correct?

Medium
27

An administrator wants to apply a role to a subset of hosts based on a condition. The condition should be evaluated for each host individually. Which approach is correct?

Easy
28

What is the most likely cause of the failure?

Hard
29

Refer to the exhibit. The playbook fails with an error. What is the most likely cause?

Medium
30

A playbook includes multiple roles. The administrator wants to skip a specific role during execution. Which technique should they use?

Easy
31

An Ansible playbook needs to ensure a service is enabled and running on boot. Which combination of parameters should be used with the 'systemd' module?

Easy
32

Drag and drop the steps to configure a logical volume (LV) using LVM on a new disk in the correct order.

Medium
33

Refer to the exhibit. An administrator runs a playbook in check mode and receives the shown output. What should be done to fix the failure while maintaining idempotency?

Hard
34

An administrator is writing a playbook that must execute a task only when a specific variable is defined. The variable may be set in the inventory, group_vars, or host_vars. Which conditional ensures the task runs only if the variable 'app_port' is defined?

Medium
35

Refer to the exhibit. An administrator runs an Ansible playbook and receives the error shown. The playbook uses a variable 'vault_httpd_port' that should be stored in an encrypted vault file. Which step should the administrator take first to resolve the issue?

Hard
36

In an Ansible playbook, the 'strategy' parameter is set to 'free'. What behavior does this strategy produce?

Easy
37

Which TWO elements can be used to include external task files in a playbook?

Easy
38

An administrator has a role named 'web' that must run a package installation task before any other tasks in the role. The role contains a tasks/main.yml file and a meta/main.yml file. The administrator wants the package installation to be a separate role named 'common' that is always executed first when the 'web' role is applied. Which approach should the administrator use?

Medium
39

An administrator needs to ensure that a task runs only on the first host in a batch and that its result is applied to all hosts in the batch. Which Ansible directive should be used?

Medium
40

You are managing a web application deployment using Ansible. The application requires a specific version of a library (libapp) to be installed on all web servers. Your current playbook uses the role 'web' which includes a task to install libapp version 1.2. However, after a recent update, the role's defaults now specify libapp version 2.0, but you must keep version 1.2 for compatibility. You have defined a variable 'lib_version' in the playbook's vars section with value '1.2'. The role's task uses the variable 'libapp_version' (not 'lib_version'). The play fails because 'libapp_version' is undefined. What is the best way to resolve this issue without modifying the role?

Easy
41

A developer wants to reuse a set of tasks that conditionally include other task files based on variables defined per host. Which method should be used to ensure the included tasks are evaluated per host at runtime?

Hard
42

An administrator wants to ensure a role's tasks are executed only on certain hosts. Which approach should they use?

Easy
43

You need to run an Ansible playbook every hour to update a dynamic inventory file from a CMDB API. The playbook is stored in /opt/ansible/update_inventory.yml. You want to schedule the execution using a cron job on the control node. The control node runs Red Hat Enterprise Linux 9. The playbook uses Ansible Vault to decrypt API credentials, and the vault password is stored in /etc/ansible/.vault_pass. Which cron entry will execute the playbook hourly?

Easy
44

An administrator needs to execute a role named `common` on all hosts in the play, but only for hosts that are members of the `webservers` group. Which playbook construct achieves this?

Easy
45

An administrator is building a reusable role and must decide how to structure variables so that callers can override values while the role still ships sensible starting values. Which TWO practices are appropriate for this role design? (Choose two.)

Medium
46

An Ansible role has a complex dependency tree. The administrator wants to ensure that dependencies are installed before the main role tasks. Which file should be used to define dependencies?

Medium
47

A role's tasks/main.yml contains a task that uses `notify: restart service`. The handler is defined in handlers/main.yml. During a playbook run, the task reports 'changed' but the handler does not run until the end of the play. The administrator wants the handler to run immediately after the task, before any subsequent tasks. Which action should be taken?

Hard
48

Refer to the exhibit. The administrator runs the playbook with the 'deploy' tag, but all tasks are skipped. What is the most likely reason?

Hard
49

An administrator maintains a role named 'webserver' whose tasks reference the variable 'http_port'. The playbook calls the role twice within the same play, first with http_port set to 8080 and then with http_port set to 8443, expecting two differently configured deployments. After the run, both deployments use port 8443. Which change to the role invocation should the administrator make so each invocation uses its own value?

Medium
50

Refer to the exhibit. An Ansible playbook task fails with 'Missing sudo password'. The playbook runs against a server where the remote user 'admin' has sudo privileges but requires a password. Which configuration change would resolve this issue?

Easy
51

Which ansible.cfg setting controls the number of parallel forks for task execution?

Easy
52

Which best practice should be followed when using Ansible to manage task execution across multiple hosts?

Easy
53

A playbook targets a group of database servers and must run a backup task only on one host at a time, waiting for each host to finish before starting the next, so that a shared storage array is not saturated. Which play keyword should the administrator set to achieve this serialized behavior?

Easy
54

A systems administrator needs to run a playbook that installs packages on a group of managed nodes. The playbook should run only on nodes that are part of the 'web_servers' group in the inventory. Which approach is best practice?

Easy
55

An administrator is writing a role that must execute a handler only if a configuration file changes. The handler is defined in handlers/main.yml. The task that modifies the configuration file uses the copy module. Which keyword must be used on the task to trigger the handler?

Medium
56

Refer to the exhibit. The playbook uses the 'yum' module to install 'httpd' on a RHEL 8 system. Which of the following is the most likely cause of the failure?

Hard
57

A team has developed several roles that share common variables. They want to organize these variables in a central file. Where should they place this file so it is automatically loaded by all roles?

Hard
58

An Ansible playbook uses the 'block' and 'rescue' directives. Which two statements are true about this construct? (Choose two.)

Medium
59

A playbook contains a task that uses the 'until' keyword with a retry count of 5 and a delay of 10. The task fails on all 5 attempts. What is the default behavior of Ansible regarding this task and subsequent tasks?

Hard
60

Which TWO statements about Ansible roles are correct?

Medium

Frequently asked questions

What does the Manage task execution and roles domain cover on the EX294 exam?
Install and reference roles correctly from Galaxy, Git, and local paths, and control task placement across hosts with hosts, serial, and delegation. The key skill is keeping every task idempotent so check mode passes and reruns report no unexpected changes.
How many questions are in this domain?
This page lists all 60 Manage task execution and roles questions in the EX294 question bank. The actual exam draws from this domain proportionally to its weighting in the official exam blueprint.
What is the best way to practise this domain?
Start with a short focused session (10 questions) to identify gaps, then work through explanations. Repeat with a longer session once the weak areas feel solid.
Can I practise only Manage task execution and roles questions?
Yes — the session launcher on this page filters questions to this domain only. Choose any session length for inline explanations and scoring.
redhat-rhce REDHAT-RHCE task execution roles Practice Questions