You must be able to control play execution with serial, delegate tasks to non-inventory hosts, and make playbooks non-interactive for CI. The single most important thing is knowing how Ansible evaluates task results and host failures so you can diagnose partial runs and hangs.
Start practicing
Implement advanced Ansible automation — choose a session length
Free · No account required
Domain overview
This domain covers advanced Ansible automation for EX294: controlling execution flow with serial, vars_prompt, and delegation, plus conditional task evaluation. Questions present realistic playbook scenarios and ask you to diagnose hangs, partial runs, or unexpected task results using core Ansible directives and modules rather than ad hoc workarounds.
Exam objectives
Using serial and max_fail_percentage to control rolling update batches across inventory hosts
Applying delegate_to and run_once to execute tasks on hosts outside the active play target
Handling vars_prompt non-interactively with extra vars or vars_prompt defaults in CI/CD
Writing failed_when and changed_when conditions to override default task result evaluation
Assuming vars_prompt can read from stdin in CI; it blocks because no TTY is attached, so pass variables via -e or defaults instead.
Thinking serial: 1 stops after one host when the real cause is a failure, unreachable host, or max_fail_percentage threshold aborting the play.
Using delegate_to without also setting run_once or connection details, causing the task to run once per host or fail on the delegated target.
Click any question to see the full explanation and answer options, or start a focused practice session above.
An administrator wants to reuse a set of tasks that configure a firewall across multiple playbooks. Which Ansible feature should be used to achieve this?
2A playbook uses the 'include_tasks' module to dynamically include tasks based on a variable. The playbook runs successfully on some hosts but fails on others with a 'template error' message. What is the most likely cause?
3An Ansible playbook is designed to run on a group of database servers. The administrator wants to ensure that a task runs only on the primary database server, which is defined in the inventory with a variable 'primary: true'. Which conditional should be used?
4A playbook uses the 'block' and 'rescue' keywords to handle errors. The block contains three tasks. The first task fails. What happens next?
5An administrator needs to securely pass a database password to a playbook without exposing it in logs or the command line. Which approach is the most secure?
6An Ansible playbook includes a role that defines default variables in 'defaults/main.yml' and role variables in 'vars/main.yml'. A playbook sets the same variable in the play's 'vars' section. Which variable value takes precedence?
7Which TWO statements about Ansible collections are correct?
8Which THREE of the following are valid uses of the 'ansible.builtin.include_role' module?
9Which TWO of the following are advantages of using 'ansible-pull' over 'ansible-playbook'?
10You are managing a large infrastructure of 500 Linux servers. The servers are divided into groups: 'web', 'app', and 'db'. Each group has specific configuration requirements. You have developed a set of Ansible roles to manage these configurations. Recently, you noticed that when you run the playbook against all servers, the 'web' role is applied to 'app' servers due to a variable misconfiguration. The playbook uses include_role with a variable that determines which role to apply. The variable is defined in group_vars/all.yml as 'server_role: web'. However, each group should have its own role: 'web' for web servers, 'app' for app servers, 'db' for db servers. The playbook includes the role based on '{{ server_role }}'. What is the best course of action to fix this issue without modifying the playbook structure?
11An Ansible automation team is designing a playbook to manage network devices. They need to ensure that the playbook can handle transient network failures by retrying failed tasks a specific number of times with a delay between retries. Which approach should they use?
12An Ansible playbook that deploys a web application includes a task that uses the `uri` module to call an external API. The task occasionally fails due to API rate limiting. Which combination of keywords should be added to the task to automatically retry up to 5 times with a 30-second delay between attempts, and only fail if all retries are exhausted?
13Drag and drop the steps to configure a network bond (bond0) using nmcli in the correct order.
14Match each Ansible fact variable to its description.
15A team wants to ensure that a sensitive variable, such as a database password, is not printed when ansible-playbook runs with -v (verbose). What is the best method to achieve this?
16An Ansible playbook runs tasks on a group of web servers. During a rolling update, the playbook should ensure that no more than 2 servers are taken out of service at the same time. Which play keyword should be used?
17An administrator wants to reuse a set of tasks across multiple playbooks. Which Ansible approach is most appropriate?
18A playbook uses 'vars_prompt' to ask for a confirmation before proceeding with destructive changes. However, when the playbook is run from a CI/CD pipeline, it hangs indefinitely. What is the best way to handle this?
19A playbook uses the 'block' feature to group tasks and includes a 'rescue' section. If a task inside the block fails, what happens?
20Which three of the following are valid methods to pass variables to an Ansible playbook at runtime? (Choose three.)
21Refer to the exhibit. What is the purpose of the 'failed_when' condition?
22A developer reports that a role's behavior is not as expected. They set a variable in the playbook's vars section, but the role still uses the value from its vars/main.yml. Which of the following explains this issue?
23An Ansible playbook uses async and poll to run a long-running task. The task reports 'async task did not complete within the requested time'. Which of the following is the most likely cause?
24An Ansible playbook uses a rolling update strategy with serial: 1. After the first host is updated, the playbook stops and shows 'PLAY RECAP' with only one host. What is the most likely reason?
25An Ansible playbook contains many tasks. An administrator wants to run only a subset of tasks by passing '--tags ' at the command line. Which of the following must be added to the tasks?
26A role contains a handler. The playbook includes the role and also defines a task that notifies the same handler. When the playbook runs, the handler executes only once. Which of the following best explains this behavior?
27Which THREE of the following are valid attributes of the ansible.builtin.service module?
28Which TWO of the following are correct about Ansible Vault?
29Refer to the exhibit. An administrator wants to view the decrypted value of 'db_password' without modifying the file. Which command should be used?
30An automation engineer wants to run a playbook only on hosts that belong to both the 'webservers' group and the 'production' group. Which inventory grouping method achieves this?
31A playbook uses the copy module to deploy a configuration file. The file should be templated with variables, but the engineer mistakenly uses the 'src' parameter with a static file instead of 'content' or a template module. What is the most likely outcome?
32An organization uses separate network hops that require different SSH usernames for different inventory groups. Which Ansible configuration approach ensures each group uses the correct SSH user without duplicating playbooks?
33A playbook uses a loop over a list of packages to ensure they are installed. However, the playbook runs slowly because each package is processed individually. Which optimization technique should be used to improve performance?
34An administrator needs to securely store a database password used across multiple roles in a shared repository. Which approach is recommended?
35A playbook uses import_playbook to include other playbooks. The main playbook is run with --check mode. Which statement is true?
36A company uses dynamic inventory from a cloud provider. The playbook needs to run tasks only on instances with a specific tag. The ansible_ec2_tags variable is not available. What is the most efficient method to filter hosts?
37An organization has a set of common tasks used in many playbooks. The tasks are updated frequently. What is the most maintainable way to share them?
38A playbook uses serial: 2 and sets any_errors_fatal: true. The first batch of 2 hosts both fail. What happens?
39A playbook uses an Ansible collection that includes a custom module. The module's documentation is missing. What is the best way to locate the module's source code?
40An administrator wants to run a playbook with a different user for a specific host. Which variable should be set?
41A playbook uses the 'block' and 'rescue' keywords. If a task in the block fails, but the rescue tasks also fail, what happens?
42Which two statements about Ansible roles are correct? (Select exactly 2.)
43Which three methods can be used to pass variables to an Ansible playbook? (Select exactly 3.)
44Which two statements about ansible-vault are true? (Select exactly 2.)
45Refer to the exhibit. An Ansible playbook contains the following block structure. If the task inside the block fails, which of the following describes the execution order of the rescue and always sections?
46A company has a large infrastructure with over 1000 servers. They run a playbook that configures NTP on all servers. The playbook takes over 30 minutes due to sequential execution. The team wants to reduce execution time. Which approach should they take?
47A new technician runs a playbook that uses the yum module to install packages. The playbook fails with 'No package matching' for a custom package. The package is available on a third-party repository. Which step should the technician take?
48A company uses Ansible Vault to encrypt sensitive data in playbooks. They have multiple environments (dev, test, prod) and use a separate vault password file for each environment. The passwords are stored in files named 'vault-pass-dev', 'vault-pass-test', and 'vault-pass-prod'. To run a playbook against the test environment, they use the command 'ansible-playbook site.yml -i test -e @test-vars.yml --vault-id test@vault-pass-test'. This runs successfully from the command line. However, when they define the same vault-id in an Ansible Tower credential and attempt to run the job, the job fails with 'ERROR! Decryption failed (no vault secrets would be found that could decrypt the vault encrypted file)' for a vault-encrypted variable file that was encrypted with a different vault ID (e.g., 'dev'). The team expects that Tower would use the provided vault credential to decrypt all vault-encrypted files. Which change should be made to ensure correct decryption in Tower?
49Refer to the exhibit. After the playbook run fails on the 'Verify config' task, what happens to the 'restart service' handler?
50Refer to the exhibit. The playbook copies all .conf files from the control node to host1. If the playbook runs again on the same host without any changes, which task status is expected?
51Refer to the exhibit. The playbook fails because the httpd package is not found. Which is the most likely cause?
52Refer to the exhibit. The playbook fails with an error about the package list. What is the issue?
53An automation engineer must ensure that a task in a playbook runs only once across all hosts in the play, even though the play targets 50 web servers. The task creates a shared DNS record on an external service. Which approach should be used?
54An administrator needs to run a playbook in check mode to preview changes on managed hosts, but a critical task using the `command` module must always execute regardless of check mode. Which task directive should be applied to that specific task?
55An Ansible playbook uses a custom filter plugin located in the `filter_plugins/` directory next to the playbook. The filter is not being applied, and the playbook fails with an error that the filter is undefined. What is the most likely reason?
56A playbook uses a variable named `db_port` that must be defined by the user at runtime, but should fall back to 5432 if the user does not provide it. Which approach ensures this behavior without failing the play when the variable is undefined?
57A playbook uses a task with 'delegate_to: localhost' to generate a report file. The task must run only once, even if the play targets multiple hosts. Which keyword should be added to the task to ensure it executes only on the first host?
58A playbook includes a role that has a task notifying a handler defined within the role. Another task in the play, outside the role, also notifies the same handler by name. After running the playbook, the administrator notices that the handler runs only once. What is the reason for this behavior?
59An automation engineer is using Ansible to manage a fleet of servers. They need to ensure that certain tasks run only on hosts that match specific criteria. Which two of the following are valid ways to limit task execution based on host facts? (Choose two.)
60A playbook must execute a task on a host that is not part of the inventory, such as a temporary cloud instance. The task should run on that host without modifying the inventory file. Which directive should be used?
61A playbook uses the `ansible.builtin.uri` module to interact with a REST API. The API requires a Bearer token that is stored in an encrypted variable file. The playbook must ensure the token is not exposed in logs. Which approach best meets the requirement?
62An administrator is writing a playbook that must execute a task only when a file exists on the remote host. They use the `stat` module to check the file and register the result. Which conditional expression should be used to run a subsequent task based on the file's existence?
63An administrator needs to run a playbook that applies a configuration only to hosts that have a specific fact, `ansible_processor_vcpus`, greater than 4. The playbook should skip hosts that do not meet this condition. Which approach should be used?
Deep-dive questions
The most-searched questions in this domain — detailed explanations, worked examples, full answer breakdowns.
You must be able to control play execution with serial, delegate tasks to non-inventory hosts, and make playbooks non-interactive for CI. The single most important thing is knowing how Ansible evaluates task results and host failures so you can diagnose partial runs and hangs.
The Courseiva EX294 question bank contains 63 questions in the Implement advanced Ansible automation domain, covering the 12% of the exam attributed to this domain in the official Red Hat blueprint. Click any question to see the full explanation and answer breakdown.
Start with a 10-question focused session to identify your baseline accuracy in this domain. Read every explanation — even for questions you answer correctly — to understand the reasoning. Once you score consistently above 80%, move to a 20–30 question session to confirm depth before moving to the next domain.
Yes — the session launcher on this page draws questions exclusively from the Implement advanced Ansible automation domain. Choose 10, 20, 30, or 50 questions for a focused session, or click individual questions to review them one by one.
Save your results, see per-domain analytics, and get readiness scores — free, for every certification.
Sign Up FreeFree forever · Every certification included