CertGrid
Linux Certification

Red Hat Certified Ansible (EX294-style) Practice Exam

Validates automation with Ansible - playbooks, roles, variables, templates, and managing systems at scale.

Start with a free Red Hat Certified Ansible (EX294-style) practice test, then work through 510 exam-style questions with full answer explanations, and use MCQ readiness practice to check concepts and command decisions before hands-on lab work.

Free account: a fixed set of 20 practice questions for this exam, retryable anytime. Paid access unlocks the full bank and timed mock exams. No credit card required to start.

510
Practice pool
Hands-on lab
Real exam
240 min
Real exam time

CertGrid MCQ practice: 50 questions. The real exam is performance-based and requires completing tasks on a live system. CertGrid provides MCQ-style readiness practice, not a live terminal lab.

Objective-mapped practice, aligned to current exam objectives · Reviewed Oct 2026 · Independent practice platform.

What the Red Hat Certified Ansible (EX294-style) exam covers

Free Red Hat Certified Ansible (EX294-style) practice test questions

A sample of 10 questions with answers and explanations. A free account includes a fixed set of 20 practice questions for this exam, retryable anytime. Paid access unlocks the full 510-question bank.

  1. Question 1Ansible Fundamentals

    Which keyword runs tasks with privilege escalation (e.g., sudo)?

    • Atags
    • Bregister
    • Cbecome: trueCorrect
    • Dnotify
    ✓ Correct answer: C

    become is the keyword that turns on privilege escalation; the guide defines it as 'set to true to activate privilege escalation.' Unless changed, become_user defaults to root and become_method to sudo, so the task runs as root through sudo while Ansible still logs in as the normal remote user. It can be set on a play, a block or a single task. Source: docs.ansible.com playbook_guide/playbooks_privilege_escalation.html.

    Why the other options are wrong
    • Atags labels tasks so they can be selected or skipped with --tags or --skip-tags; it grants no privileges.
    • Bregister saves a task's result in a variable; it does not change which user the task runs as.
    • Dnotify sends handler names when the task reports changed; it has nothing to do with privileges.
  2. Question 2Playbooks and Tasks

    A play file contains two list items at the top level, each with its own 'hosts' and 'tasks'. What does running it do?

    • AAnsible executes both plays in order, each against its own host setCorrect
    • BOnly the first play runs; the second is ignored
    • CThe two plays run concurrently on the same hosts
    • DIt errors because a playbook can contain only one play
    ✓ Correct answer: A

    A playbook is a YAML list of plays, and the playbook guide states that 'A playbook runs in order from top to bottom' and that 'Playbooks with multiple plays can orchestrate multimachine deployments, running one play on your webservers, another play on your database servers'. Each list item with its own hosts and tasks is a separate play, so Ansible finishes the first play and then starts the second against its own host pattern. Source: docs.ansible.com playbook_guide/playbooks_intro.html.

    Why the other options are wrong
    • BAnsible does not stop after the first play; every play in the list runs in order unless a failure ends the run.
    • CPlays run one after another, not concurrently, and each play targets its own hosts pattern rather than one shared host set.
    • DA playbook is a list of plays, and several plays in one file is the normal, documented layout.
  3. Question 3Roles and Reuse

    A template task inside a role uses 'src: nginx.conf.j2' with no path prefix. From which role subdirectory will Ansible resolve that Jinja2 template file?

    • Atemplates/Correct
    • Bfiles/
    • Cvars/
    • Ddefaults/
    ✓ Correct answer: A

    The roles guide states 'Any copy, script, template or include tasks (in the role) can reference files in roles/x/{files,templates,tasks}/ (dir depends on task) without having to path them relatively or absolutely.' For the template module that directory is templates/, documented as 'templates/something.j2 - templates to use in the role or child roles.' This role-relative search keeps the role portable wherever it is installed. Source: docs.ansible.com Roles, Role directory structure.

    Why the other options are wrong
    • Bfiles/ is where copy and script look for static files; the template module searches templates/.
    • Cvars/ holds the role's high-precedence variables in main.yml; it is not a search path for template sources.
    • Ddefaults/ holds the role's low-precedence variables; template files are not resolved from it.
  4. Question 4Inventory

    An aws_ec2 inventory config builds groups from the Environment tag: ```yaml keyed_groups: - key: tags.Environment prefix: env ``` Instances whose Environment tag exists but has an empty value are not placed in any env group. You want them in a group named env_unknown instead. Which keyed_groups setting achieves this?

    • Adefault_value: unknown (with prefix: env)Correct
    • Btrailing_separator: false
    • Cleading_separator: false
    • Dstrict: true
    ✓ Correct answer: A

    The constructed and aws_ec2 option tables describe keyed_groups default_value, added in ansible-core 2.12, as 'The default value when the host variable's value is None or an empty string'. In ansible-core's keyed_groups logic an empty string key creates no group unless default_value is set ('if key is empty, 'default_value' will be used as group name'), so with prefix: env and the default separator _ those instances land in env_unknown. The option is mutually exclusive with trailing_separator. Source: docs.ansible.com ansible.builtin.constructed inventory, keyed_groups; ansible-core lib/ansible/plugins/inventory/__init__.py.

    Why the other options are wrong
    • Btrailing_separator only changes a name built from a mapping key such as tags, dropping the separator after an empty tag value; it supplies no fallback value, so no env_unknown group is created.
    • Cleading_separator controls whether a group name starts with the separator when no prefix is set; with prefix: env it has no effect and supplies no fallback value.
    • Dstrict: true turns templating errors in keyed_groups or compose into fatal errors instead of skipping them; it does not assign a fallback group name.
  5. Question 5Variables and Templates

    secrets.yml was encrypted with ansible-vault. You need to change one password stored inside it and leave the file encrypted afterwards. Which command does this in one step?

    • Aansible-vault decrypt secrets.yml
    • Bansible-vault edit secrets.ymlCorrect
    • Cansible-vault rekey secrets.yml
    • Dansible-vault view secrets.yml
    ✓ Correct answer: B

    The vault guide states: 'To edit an encrypted file in place, use the ansible-vault edit command. This command decrypts the file to a temporary file, allows you to edit the content, then saves and re-encrypts the content and removes the temporary file when you close the editor.' The plaintext therefore exists briefly in that temporary file, and the guide warns that editor swap or backup files can keep clear text copies. Source: docs.ansible.com vault_guide/vault_encrypting_content.html.

    Why the other options are wrong
    • Adecrypt writes the file back as plaintext and leaves it that way until you encrypt it again.
    • Crekey changes the vault password that protects the file; the variable values inside stay the same.
    • Dview only displays the decrypted content; nothing can be saved back.
  6. Question 6Playbooks and Tasks

    A task starts a Java application that can take two minutes to begin listening on TCP port 8080. The next task must not run on a host until that port accepts connections. Which module do you use for the task in between?

    • Aansible.builtin.wait_forCorrect
    • Bansible.builtin.wait_for_connection
    • Cansible.builtin.pause
    • Dansible.builtin.async_status
    ✓ Correct answer: A

    wait_for 'Waits for a condition before continuing'; with port: 8080 it polls the port until it accepts connections, up to its timeout, which defaults to 300 seconds. The module page notes that 'Waiting for a port to become available is useful for when services are not immediately available after their init scripts return'. wait_for_connection instead waits for Ansible's own connection to the managed node, and pause waits a fixed time or for a prompt. Sources: docs.ansible.com collections/ansible/builtin/wait_for_module.html and wait_for_connection_module.html.

    Why the other options are wrong
    • Bwait_for_connection 'Waits until remote system is reachable/usable' through Ansible's transport; it does not test an application port.
    • Cpause 'Pauses playbook execution for a set amount of time, or until a prompt is acknowledged'; it never checks whether the port is open.
    • Dasync_status checks the job id of a task started with async; it does not poll a TCP port.
  7. Question 7Ansible Fundamentals

    A teammate wants a ready-to-paste task skeleton listing the parameters of the copy module. Which command prints it?

    • Aansible-doc -s ansible.builtin.copyCorrect
    • Bansible-doc -j ansible.builtin.copy
    • Cansible-doc -F ansible.builtin.copy
    • Dansible-doc -l ansible.builtin
    ✓ Correct answer: A

    The ansible-doc reference lists '-s, --snippet: Show playbook snippet for these plugin types', which prints a task skeleton with each of the module's options and a short description, ready to paste into a playbook. -j prints the documentation as JSON, -F shows plugin names with their source files (it implies --list) and -l lists available plugins, here limited to the ansible.builtin collection. Source: docs.ansible.com cli/ansible-doc.html.

    Why the other options are wrong
    • B-j outputs the module's documentation as JSON, not as a YAML task to paste.
    • C-F shows plugin names and their source file paths, not a task skeleton.
    • D-l lists the plugins in the collection with short descriptions; it shows no parameters for copy.
  8. Question 8Inventory

    An inventory directory holds a YAML inventory file, an INI inventory file and a group_vars/ subdirectory. An engineer runs: ``` ansible-playbook -i inventory/ site.yml ``` What does Ansible do with the directory?

    • AIt stops with an error, since -i must name a single inventory file, not a directory
    • BIt reads only the first file in alphabetical order and ignores the remaining files
    • CIt merges every inventory file it can parse in the directory into one inventoryCorrect
    • DIt parses group_vars/ as a host inventory and skips the YAML and INI files beside it
    ✓ Correct answer: C

    The inventory guide explains that with a directory 'your directory becomes your single inventory source, and Ansible aggregates the multiple sources it finds in that directory.' Each file is parsed by whichever inventory plugin accepts it, and the sources are merged in alphabetical order of filename. group_vars/ in that directory is read as variable files by the host_group_vars plugin, not as an inventory. Source: docs.ansible.com inventory_guide/intro_inventory.html.

    Why the other options are wrong
    • A-i accepts a directory as well as a file, and the option may also be given more than once.
    • BEvery valid source in the directory is used; filename order only decides the order in which they are merged.
    • Dgroup_vars/ is loaded as variables for the matching groups; it is not parsed as an inventory of hosts.
  9. Question 9Variables and Templates

    A template indents its control tags for readability: ```jinja [servers] {% for host in groups['web'] %} server {{ host }} {% endfor %} ``` Rendered with ansible.builtin.template and no extra options, every server line comes out indented by four spaces. Which template task option removes that indentation?

    • Alstrip_blocks: trueCorrect
    • Btrim_blocks: true
    • Cnewline_sequence: '\n'
    • Dblock_start_string: '{%-'
    ✓ Correct answer: A

    The template module documents lstrip_blocks as 'When set to yes leading spaces and tabs are stripped from the start of a line to a block', and its default is false. trim_blocks already defaults to true ('Since Ansible 0.9, templates are loaded with trim_blocks=True'), so the newline after each tag is removed but the four spaces in front of the tag stay and end up in front of the next server line. Turning on lstrip_blocks removes that leading whitespace while the tags stay indented in the source. Source: docs.ansible.com ansible.builtin.template module (lstrip_blocks, trim_blocks).

    Why the other options are wrong
    • Btrim_blocks removes the first newline after a block tag and is already true by default in the template module, so setting it again leaves the leading spaces in place.
    • Cnewline_sequence only chooses the line-ending characters written to the file; it does not strip spaces in front of block tags.
    • Dblock_start_string changes the delimiter Jinja2 looks for, so the existing {% tags would no longer be parsed as blocks; whitespace in front of tags is handled by lstrip_blocks or a {%- modifier written in the tag.
  10. Question 10Roles and Reuse

    A play lists the same role three times with identical settings: ```yaml - hosts: web roles: - motd - motd - motd ``` Only the first entry runs. What makes all three entries run?

    • Aallow_duplicates: true in the role's meta/main.ymlCorrect
    • Ballow_duplicates: true in the role's defaults/main.yml
    • Cserial: 3 set on the play that applies the role
    • Drun_once: false set on each of the roles: entries
    ✓ Correct answer: A

    The roles guide states 'Ansible only executes each role once in a play, even if you define it multiple times unless the parameters defined on the role are different for each definition.' Here the three entries are identical, so the role's metadata must opt in: 'Add allow_duplicates: true to the meta/main.yml file for the role'. With different parameters on each entry, the role would run each time without that setting. Source: docs.ansible.com Roles, Running a role multiple times in one play.

    Why the other options are wrong
    • Bdefaults/main.yml holds variables; allow_duplicates is read from the role's metadata in meta/main.yml.
    • Cserial sets how many hosts are handled per batch; it does not change role de-duplication.
    • Drun_once controls whether a task runs on one host or all hosts; it does not stop a repeated role from being de-duplicated.

Who this Red Hat Certified Ansible (EX294-style) practice exam is for

This practice set is for anyone preparing for the Red Hat Certified Ansible (EX294-style) exam - from first-time candidates building a foundation to experienced Linux practitioners doing a final review before test day. If you learn best by working through realistic questions and reading why each answer is right or wrong, it is built for you.

How to use this Red Hat Certified Ansible (EX294-style) practice exam

  1. Start with the free sample questions above to gauge your current baseline.
  2. Read the full explanation on every question, including why each wrong option is wrong.
  3. Track your weak domains and focus your study where you are losing the most marks.
  4. Once you are scoring consistently well, take a timed, full-length mock exam.
  5. Treat your readiness score as knowledge readiness, then validate it with hands-on practice in a real environment before booking the Red Hat Certified Ansible (EX294-style) exam.

Related Linux resources

Red Hat Certified Ansible (EX294-style) practice exam FAQ

How many questions are in the Red Hat Certified Ansible (EX294-style) practice exam on CertGrid?

CertGrid has 510 practice questions for Red Hat Certified Ansible (EX294-style), covering 5 exam domains. The real EX294 is a hands-on performance-based lab exam, not a fixed multiple-choice count. Red Hat now calls it the Red Hat Certified Advanced System Administrator in Ansible exam, reports it as pass or fail with a breakdown by objective area, and publishes no cut score. Use these MCQs to drill the concepts and syntax, and pair them with hands-on Ansible practice. CertGrid's MCQ readiness practice covers 50 questions.

Is CertGrid a hands-on Linux lab simulator?

No. The real Red Hat Certified Ansible (EX294-style) exam is a hands-on, performance-based lab exam. CertGrid provides MCQ-style readiness practice to help you check concepts, commands, troubleshooting choices, and weak domains before doing hands-on labs - it is not a live lab simulator.

What is the passing score for Red Hat Certified Ansible (EX294-style)?

Red Hat reports its performance-based exams as pass or fail with a breakdown by objective area and does not publish a cut score, so CertGrid scores this mock against its own readiness threshold. You have about 240 min to complete it. CertGrid tracks your readiness across every objective so you know where to focus your hands-on lab practice.

Are these official Red Hat Certified Ansible (EX294-style) exam questions?

No. CertGrid is an independent practice platform. We do not provide real or leaked exam questions. Our questions are original and designed to help you practice the concepts, scenarios, and difficulty style of the Red Hat Certified Ansible (EX294-style) exam.

Is there a free Red Hat Certified Ansible (EX294-style) practice test?

Yes. You can take a free Red Hat Certified Ansible (EX294-style) practice test straight away: a fixed set of 20 practice questions for this exam, retryable as often as you like, with no credit card required. You get readiness scoring and a weak-domain breakdown on those questions. Paid plans unlock the full 510-question bank, timed mock exams and full-bank domain analytics.

What CertGrid is (and is not)

CertGrid is an independent IT certification practice platform for Azure, AWS, Google, Cisco, Security, Linux, Kubernetes, Terraform, and other certification tracks. It provides objective-mapped practice questions, readiness scoring, weak-domain drills, and explanations to help learners understand what to study next.

Independent & original. CertGrid is an independent practice platform and is not affiliated with or endorsed by Red Hat. Questions are original practice items designed to mirror certification concepts and exam style. CertGrid does not provide official exam questions or braindumps.