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.
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.
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?
Medium2An 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?
Hard3A 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?
Medium4An 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?
Easy5An 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?
Medium6Refer to the exhibit. An administrator runs the playbook but the wait_for task fails. What is the most likely cause?
Hard7Match each systemd unit type to its description.
Medium8An 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.)
Hard9A 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?
Hard10An 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?
Medium11Which two statements are true regarding Ansible roles? (Choose two.)
Easy12An 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.)
Hard13Which TWO statements about Ansible role defaults are true?
Hard14An 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?
Hard15An 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?
Hard16What is the purpose of the 'meta: flush_handlers' task?
Easy17What is the purpose of the 'vars' keyword under the httpd role inclusion?
Easy18An administrator wants to define role dependencies. In which file should they place the dependencies declaration?
Hard19An 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?
Hard20Refer 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?
Medium21An 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?
Medium22Which 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?
Easy23An 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?
Hard24A 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?
Medium25An 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?
Hard26Which TWO of the following statements about Ansible roles are correct?
Medium27An 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?
Easy28What is the most likely cause of the failure?
Hard29Refer to the exhibit. The playbook fails with an error. What is the most likely cause?
Medium30A playbook includes multiple roles. The administrator wants to skip a specific role during execution. Which technique should they use?
Easy31An Ansible playbook needs to ensure a service is enabled and running on boot. Which combination of parameters should be used with the 'systemd' module?
Easy32Drag and drop the steps to configure a logical volume (LV) using LVM on a new disk in the correct order.
Medium33Refer 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?
Hard34An 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?
Medium35Refer 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?
Hard36In an Ansible playbook, the 'strategy' parameter is set to 'free'. What behavior does this strategy produce?
Easy37Which TWO elements can be used to include external task files in a playbook?
Easy38An 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?
Medium39An 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?
Medium40You 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?
Easy41A 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?
Hard42An administrator wants to ensure a role's tasks are executed only on certain hosts. Which approach should they use?
Easy43You 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?
Easy44An 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?
Easy45An 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.)
Medium46An 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?
Medium47A 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?
Hard48Refer to the exhibit. The administrator runs the playbook with the 'deploy' tag, but all tasks are skipped. What is the most likely reason?
Hard49An 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?
Medium50Refer 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?
Easy51Which ansible.cfg setting controls the number of parallel forks for task execution?
Easy52Which best practice should be followed when using Ansible to manage task execution across multiple hosts?
Easy53A 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?
Easy54A 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?
Easy55An 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?
Medium56Refer 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?
Hard57A 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?
Hard58An Ansible playbook uses the 'block' and 'rescue' directives. Which two statements are true about this construct? (Choose two.)
Medium59A 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?
Hard60Which TWO statements about Ansible roles are correct?
MediumOther domains
All EX294 exam domains
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.