A task fails on one host. With default error handling, what happens to that host?Answer: It is removed from the rotation for the rest of the playbook. Ansible documentation, Ansible playbooks
A task must repeat until a command succeeds. Which keywords belong together?Answer: until, retries and delay. Ansible documentation, Loops
A YAML value begins with a Jinja2 variable. Which line is right?Answer: path: "{{ base }}/22". Ansible documentation, Using variables
At a minimum, what two things does each play define?Answer: The managed nodes to target and at least one task. Ansible documentation, Ansible playbooks
Show all 157 questions
Core components, continued
Conditions are given to when as a list. How are they joined?Answer: By and: all must be true. Ansible documentation, Conditionals
Custom facts are read from facts.d. Under which key do they appear?Answer: ansible_local. Ansible documentation, Discovering variables: facts and magic variables
How is a value written after when?Answer: As a raw expression, with no double braces. Ansible documentation, Conditionals
How is fact gathering switched off for a play?Answer: gather_facts: false. Ansible documentation, Discovering variables: facts and magic variables
In a loop over a list, which variable holds the current element?Answer: item. Ansible documentation, Loops
In what order do the tasks of a play run by default?Answer: Each task on all matched hosts before the next task. Ansible documentation, Ansible playbooks
What does it mean that a module is idempotent?Answer: Running the task again does not change the final state. Ansible documentation, Ansible playbooks
Where do custom facts of a managed node go by default?Answer: /etc/ansible/facts.d, in files that end in .fact. Ansible documentation, Discovering variables: facts and magic variables
Which expression reads the address of the interface from the facts of the host?Answer: ansible_facts['default_ipv4']['address']. Ansible documentation, Discovering variables: facts and magic variables
Which keyword renames the loop variable from item to something else?Answer: loop_var, under loop_control. Ansible documentation, Loops
Which of these is a valid Ansible variable name?Answer: web_port. Ansible documentation, Using variables
Which source of a variable always wins?Answer: Extra vars, given with -e. Ansible documentation, Using variables
Which source of a variable has the lowest precedence of these four?Answer: Role defaults. Ansible documentation, Using variables
Which special variable is the name of the current host as written in the inventory?Answer: inventory_hostname. Ansible documentation, Special variables
Which variable holds the variables and gathered facts of every other host?Answer: hostvars. Ansible documentation, Special variables
Configure Ansible
How many forks does Ansible use by default?Answer: 5. Ansible documentation, Ansible configuration settings
In an INI inventory, which heading gives variables to the group web?Answer: [web:vars]. Ansible documentation, How to build your inventory
In an INI inventory, which heading makes a group of other groups called dc?Answer: [dc:children]. Ansible documentation, How to build your inventory
In ansible-navigator.yml, which setting names the container image to run in?Answer: execution-environment: image. Ansible documentation, Ansible Navigator, settings
In which order is ansible.cfg looked for?Answer: ANSIBLE_CONFIG, current directory, ~/.ansible.cfg, /etc/ansible/ansible.cfg. Ansible documentation, Ansible configuration settings
Two configuration files are found in the search order. What does Ansible do?Answer: Uses the first and ignores the other. Ansible documentation, Ansible configuration settings
Under which key does ansible-navigator.yml hold all its settings?Answer: ansible-navigator. Ansible documentation, Ansible Navigator, settings
What is ansible-navigator's mode when none is set?Answer: interactive. Ansible documentation, Ansible Navigator, settings
When does Ansible refuse the ansible.cfg of the current directory?Answer: When the directory is world-writable. Ansible documentation, Ansible configuration settings
Where does a file of variables for the group web go, beside the inventory?Answer: group_vars/web. Ansible documentation, How to build your inventory
Which ansible-config command shows the current settings, merged with the defaults?Answer: dump. Ansible documentation, ansible-config
Which ansible-config option lists only settings that differ from the defaults?Answer: --only-changed. Ansible documentation, ansible-config
Which ansible.cfg key, under [defaults], names the user that logs in to the target?Answer: remote_user. Ansible documentation, Ansible configuration settings
Which ansible.cfg key, under [defaults], sets the inventory to use?Answer: inventory. Ansible documentation, Ansible configuration settings
Which ansible.cfg key, under [defaults], sets where roles are searched?Answer: roles_path. Ansible documentation, Ansible configuration settings
Which command prints the inventory as a tree of groups?Answer: ansible-inventory --graph. Ansible documentation, ansible-inventory
Which command writes an example ansible.cfg with every line commented out?Answer: ansible-config init --disabled > ansible.cfg. Ansible documentation, Ansible configuration settings
Which inventory line stands for www01 to www50?Answer: www[01:50].example.com. Ansible documentation, How to build your inventory
Which inventory variable gives the real address of an aliased host?Answer: ansible_host. Ansible documentation, How to build your inventory
Which line goes under [privilege_escalation] to become another user on every task?Answer: become = true. Ansible documentation, Ansible configuration settings
Which mark may begin an inline comment after a value in ansible.cfg?Answer: ;. Ansible documentation, Ansible configuration settings
Which pattern means hosts in web that are not in phoenix?Answer: web:!phoenix. Ansible documentation, Patterns: targeting hosts and groups
Which pattern means hosts that are in both web and staging?Answer: web:&staging. Ansible documentation, Patterns: targeting hosts and groups
Which two groups does every inventory have by default?Answer: all and ungrouped. Ansible documentation, How to build your inventory
Managed nodes
become is set and become_user is not. As whom does the task run?Answer: root. Ansible documentation, Ansible configuration settings
In authorized_key, which parameter removes every other key of the user?Answer: exclusive: true. Ansible documentation, ansible.posix.authorized_key module
In copy, which parameter writes text straight from the playbook, with no source file?Answer: content. Ansible documentation, ansible.builtin.copy module
What does ansible.builtin.ping return on success?Answer: pong. Ansible documentation, ansible.builtin.ping module
Which ad hoc command pings every host of the inventory?Answer: ansible all -m ansible.builtin.ping. Ansible documentation, ansible.builtin.ping module
Which keyword makes a task run with the privileges of another user?Answer: become: true. Ansible documentation, Understanding privilege escalation: become
Which module adds a host key to a known_hosts file?Answer: ansible.builtin.known_hosts. Ansible documentation, ansible.builtin.known_hosts module
Which module brings a file from managed nodes back to the control node?Answer: ansible.builtin.fetch. Ansible documentation, ansible.builtin.fetch module
Which module copies a file from the control node to a managed node?Answer: ansible.builtin.copy. Ansible documentation, ansible.builtin.copy module
Which module only tests that Ansible can log in and find a usable Python?Answer: ansible.builtin.ping. Ansible documentation, ansible.builtin.ping module
Which module puts a public SSH key into a user's account on the managed node?Answer: ansible.posix.authorized_key. Ansible documentation, ansible.posix.authorized_key module
Which module runs a command over SSH on a host that has no Python yet?Answer: ansible.builtin.raw. Ansible documentation, ansible.builtin.raw module
Which option of ansible-playbook asks for the become password?Answer: -K. Ansible documentation, ansible-playbook
Which option of ansible-playbook runs with become?Answer: -b. Ansible documentation, ansible-playbook
Run playbooks
Which ansible-navigator subcommand browses the collections you have?Answer: collections. Ansible documentation, Ansible Navigator, subcommands
Which ansible-navigator subcommand explores an earlier run from its artifact?Answer: replay. Ansible documentation, Ansible Navigator, subcommands
Which ansible-navigator subcommand runs a playbook?Answer: run. Ansible documentation, Ansible Navigator, subcommands
Which ansible-navigator subcommand shows the documentation of a module?Answer: doc. Ansible documentation, Ansible Navigator, subcommands
Which command prints a module's documentation in the terminal without ansible-navigator?Answer: ansible-doc. Ansible documentation, ansible-doc
Which option begins the playbook at a named task?Answer: --start-at-task. Ansible documentation, ansible-playbook
Which option limits a run to some of the hosts?Answer: --limit. Ansible documentation, ansible-playbook
Which option of ansible-doc prints a snippet to paste into a playbook?Answer: -s. Ansible documentation, ansible-doc
Which option of ansible-navigator run gives plain output like ansible-playbook?Answer: -m stdout. Ansible documentation, Ansible Navigator, settings
Which option of ansible-playbook checks the syntax and executes nothing?Answer: --syntax-check. Ansible documentation, ansible-playbook
Which option of ansible-playbook predicts changes and makes none?Answer: --check. Ansible documentation, ansible-playbook
Which option runs only tasks tagged packages?Answer: --tags packages. Ansible documentation, Tags
Which option shows the lines that change in small files and templates?Answer: --diff. Ansible documentation, ansible-playbook
Which tag makes a task run on every run, unless skipped by name?Answer: always. Ansible documentation, Tags
Source control with Git
Which Ansible module deploys files from a Git checkout on a managed node?Answer: ansible.builtin.git. Ansible documentation, ansible.builtin.git module
Which command copies a remote repository into a new directory?Answer: git clone <url>. Git documentation, git-clone
Which command lists changed files that are not yet staged?Answer: git status. Git documentation, git-status
Which command puts a changed playbook into the index for the next commit?Answer: git add site.yml. Git documentation, git-add
Which command records the staged changes with a message?Answer: git commit -m "Add play". Git documentation, git-commit
Which command sends local commits to the remote repository?Answer: git push. Git documentation, git-push
Plays and playbooks
A handler is notified by three tasks of a play. How often does it run?Answer: Once, at the end of the tasks. Ansible documentation, Handlers: running operations on change
A notifying task reports ok, not changed. What does its handler do?Answer: It does not run. Ansible documentation, Handlers: running operations on change
How is a task kept from ever reporting changed?Answer: changed_when: false. Ansible documentation, Error handling in playbooks
In a block, which section runs only when a task of the block fails?Answer: rescue. Ansible documentation, Blocks
In a block, which section runs whether or not a task failed?Answer: always. Ansible documentation, Blocks
In the command module, which parameter skips the task if a file already exists?Answer: creates. Ansible documentation, ansible.builtin.command module
result holds the output of a command module. Which field is its exit status?Answer: result.rc. Ansible documentation, ansible.builtin.command module
Which field of a command's result is its output as a list of lines?Answer: stdout_lines. Ansible documentation, ansible.builtin.command module
Which keyword defines for yourself when a task counts as failed?Answer: failed_when. Ansible documentation, Error handling in playbooks
Which keyword runs a task on another host in place of the current one?Answer: delegate_to. Ansible documentation, Controlling where tasks run: delegation and local actions
Which keyword runs a task once for the whole batch of hosts?Answer: run_once: true. Ansible documentation, Controlling playbook execution: strategies and more
Which keyword saves the result of a task in a variable?Answer: register. Ansible documentation, Using variables
Which module checks that expressions are true and fails if not?Answer: ansible.builtin.assert. Ansible documentation, ansible.builtin.assert module
Which module sets a host variable from a value given in the task itself?Answer: ansible.builtin.set_fact. Ansible documentation, ansible.builtin.set_fact module
Which module stops a play on a host with a message of your own?Answer: ansible.builtin.fail. Ansible documentation, ansible.builtin.fail module
Which of these modules can run a command line with a pipe or a redirect?Answer: ansible.builtin.shell. Ansible documentation, ansible.builtin.command module
Which play keyword limits how many hosts are handled at a time?Answer: serial. Ansible documentation, Controlling playbook execution: strategies and more
Which play keyword loads variables from YAML files?Answer: vars_files. Ansible documentation, Playbook keywords
Which section of a play runs before its roles?Answer: pre_tasks. Ansible documentation, Roles
Which task keyword lets a host go on with the play after that task fails?Answer: ignore_errors: true. Ansible documentation, Error handling in playbooks
Which task runs the notified handlers now instead of at the end?Answer: meta: flush_handlers. Ansible documentation, Handlers: running operations on change
Roles and collections
How is a module of a collection named in full?Answer: namespace.collection.module. Ansible documentation, Using collections in a playbook
How is a role included in the middle of a task list, decided at run time?Answer: ansible.builtin.include_role. Ansible documentation, Roles
In which directory of a role do Jinja2 templates go?Answer: templates. Ansible documentation, Roles
In which directory of a role do the lowest-precedence variables go?Answer: defaults. Ansible documentation, Roles
Under which key does requirements.yml list collections?Answer: collections. Ansible documentation, Installing collections
Which command installs a collection from a tarball you downloaded?Answer: ansible-galaxy collection install my.tar.gz. Ansible documentation, Installing collections
Which command installs the collection ansible.posix from Galaxy?Answer: ansible-galaxy collection install ansible.posix. Ansible documentation, Installing collections
Which command installs the roles listed in a file?Answer: ansible-galaxy install -r requirements.yml. Ansible documentation, Galaxy user guide
Which command makes the directory skeleton of a role called web?Answer: ansible-galaxy role init web. Ansible documentation, ansible-galaxy
Which file of a role is the list of tasks it runs?Answer: tasks/main.yml. Ansible documentation, Roles
Which file of a role lists the other roles it depends on?Answer: meta/main.yml. Ansible documentation, Roles
Which of these is processed before the play runs, as a static import?Answer: import_tasks. Ansible documentation, Reusing Ansible artifacts
Which option of ansible-galaxy install chooses the directory for the roles?Answer: -p. Ansible documentation, ansible-galaxy
Which play keyword lists collections to search for short module names?Answer: collections. Ansible documentation, Using collections in a playbook
RHCSA tasks with modules
A firewalld task sets permanent: true. Which parameter applies the rule at once as well?Answer: immediate: true. Ansible documentation, ansible.posix.firewalld module
How does dnf's name point to the package group Development tools?Answer: "@Development tools". Ansible documentation, ansible.builtin.dnf module
In dnf, which state removes a package?Answer: absent. Ansible documentation, ansible.builtin.dnf module
In mount, which state mounts now and writes the line in fstab?Answer: mounted. Ansible documentation, ansible.posix.mount module
In mount, which state writes fstab and does not mount the device?Answer: present. Ansible documentation, ansible.posix.mount module
In seboolean, which parameter keeps the value after a reboot?Answer: persistent: true. Ansible documentation, ansible.posix.seboolean module
In service, which state always stops and starts the service?Answer: restarted. Ansible documentation, ansible.builtin.service module
In user, which pair adds the group wheel and keeps the user's other groups?Answer: groups: wheel and append: true. Ansible documentation, ansible.builtin.user module
unarchive must unpack an archive that is already on the managed node. Which parameter?Answer: remote_src: true. Ansible documentation, ansible.builtin.unarchive module
What must user's password parameter hold on Linux?Answer: An encrypted hash. Ansible documentation, ansible.builtin.user module
Which module adds a DNF repository to a managed node?Answer: ansible.builtin.yum_repository. Ansible documentation, ansible.builtin.yum_repository module
Which module imports a GPG key into the RPM database?Answer: ansible.builtin.rpm_key. Ansible documentation, ansible.builtin.rpm_key module
Which module inserts several lines between marker lines?Answer: ansible.builtin.blockinfile. Ansible documentation, ansible.builtin.blockinfile module
Which module makes a compressed archive of files on the managed node?Answer: community.general.archive. Ansible documentation, community.general.archive module
Which module makes a file system on a device?Answer: community.general.filesystem. Ansible documentation, community.general.filesystem module
Which module makes a partition on a disk?Answer: community.general.parted. Ansible documentation, community.general.parted module
Which module makes a volume group?Answer: community.general.lvg. Ansible documentation, community.general.lvg module
Which module makes or resizes a logical volume?Answer: community.general.lvol. Ansible documentation, community.general.lvol module
Which module makes sure one line is in a file, or replaces one by a regular expression?Answer: ansible.builtin.lineinfile. Ansible documentation, ansible.builtin.lineinfile module
Which module manages a cron job?Answer: ansible.builtin.cron. Ansible documentation, ansible.builtin.cron module
Which module opens http in the firewall of a managed node?Answer: ansible.posix.firewalld. Ansible documentation, ansible.posix.firewalld module
Which module reboots a machine and waits for it to come back?Answer: ansible.builtin.reboot. Ansible documentation, ansible.builtin.reboot module
Which module schedules a command to run one time in the future?Answer: ansible.posix.at. Ansible documentation, ansible.posix.at module
Which module sets SELinux to enforcing?Answer: ansible.posix.selinux. Ansible documentation, ansible.posix.selinux module
Which module sets the SELinux file context mapping for a path?Answer: community.general.sefcontext. Ansible documentation, community.general.sefcontext module
Which parameter of service makes a service start at boot?Answer: enabled: true. Ansible documentation, ansible.builtin.service module
Which state of the file module makes a directory, with missing parents?Answer: directory. Ansible documentation, ansible.builtin.file module
Which state of the file module makes a symbolic link?Answer: link. Ansible documentation, ansible.builtin.file module
Which task line installs the newest version of httpd on Red Hat Enterprise Linux?Answer: ansible.builtin.dnf: name=httpd state=latest. Ansible documentation, ansible.builtin.dnf module
Templates and Vault
Does a vaulted file protect the data while a task is using it?Answer: No, only at rest. Ansible documentation, Ansible Vault
In a Jinja2 template, which marks print a variable?Answer: {{ }}. Ansible documentation, ansible.builtin.template module
In a template, which variable lists the hosts of group web?Answer: groups['web']. Ansible documentation, Special variables
Where does Jinja2 templating take place?Answer: On the control node, before the task is sent. Ansible documentation, Templating (Jinja2)
Which ansible-vault command changes the password of an encrypted file?Answer: rekey. Ansible documentation, Encrypting content with Ansible Vault
Which command encrypts a file that already exists in plain text?Answer: ansible-vault encrypt vars.yml. Ansible documentation, Encrypting content with Ansible Vault
Which command makes a new encrypted file and opens it in an editor?Answer: ansible-vault create secret.yml. Ansible documentation, ansible-vault
Which command makes one encrypted value to paste into a YAML file?Answer: ansible-vault encrypt_string. Ansible documentation, Encrypting content with Ansible Vault
Which filter gives a value when a variable is not defined?Answer: default. Ansible documentation, Using filters to manipulate data
Which keyword keeps a task's secret values out of the output and the log?Answer: no_log: true. Ansible documentation, Playbook keywords
Which module sends a Jinja2 file out with its variables filled in?Answer: ansible.builtin.template. Ansible documentation, ansible.builtin.template module
Which option makes ansible-playbook ask for the vault password?Answer: --ask-vault-pass. Ansible documentation, Using encrypted variables and files
Which option reads the vault password from a file?Answer: --vault-password-file. Ansible documentation, Using encrypted variables and files
Which parameter of template keeps a dated copy of the old file?Answer: backup: true. Ansible documentation, ansible.builtin.template module
Which parameter of template tests the new file before it replaces the old one?Answer: validate. Ansible documentation, ansible.builtin.template module
Which tag marks an inline encrypted value in YAML?Answer: !vault. Ansible documentation, Encrypting content with Ansible Vault
How this list was compiled: Own questions, sorted by the study points Red Hat publishes for exam EX294 (redhat.com, read November 29, 2026). Facts were read on November 29, 2026 in the Ansible documentation (docs.ansible.com), the Ansible Navigator documentation and the Git manual pages. Each question names the page it was written from and links to it. License: Every question, wrong choice and explanation was written for this site from the public pages named in each question. Nothing is copied or reworded from a Red Hat exam, a sample task or another practice product.
How it works
An unofficial RHCE practice exam: 157 of our own Ansible questions, sorted by the EX294 objectives Red Hat publishes. This site is not affiliated with Red Hat, and nothing here is taken from the real exam.
Read the full guide
What the real exam asks
Tasks at a machine, not multiple choice. You write playbooks, and they are scored by running them against freshly installed systems. Internet, notes and books are barred. Red Hat’s page, read November 29, 2026, now titles EX294 the Red Hat Certified Advanced System Administrator in Ansible exam.
What these questions are for
Syntax you should not have to look up: module names, keywords, options and file places, in nine topics that follow the objectives. Lab every topic where you miss two. Not here: playbooks to write, VS Code, and the RHCSA tasks without Ansible.
become_user alone switches nothing on: become must be true as well.
ansible-doc -s prints a playbook snippet of a module, so learn to find a module before you learn its parameters.
Questions and answers
Does passing EX294 make me an RHCE?
With the RHCSA, yes: Red Hat’s page says an RHCSA who passes EX294 becomes a Red Hat Certified Engineer in Ansible. The exam by itself gives the Advanced System Administrator in Ansible certificate.
How many questions are on the RHCE exam?
Red Hat’s exam page gives no number: you get a list of tasks with an end state to reach. Exam mode here sets 40 multiple-choice questions, our number, with no clock and no pass mark.
Can I use documentation in the exam?
Red Hat says that for most exams the documentation shipped with the product is there, and its EX294 objectives include looking up modules in it. Practice with ansible-doc and ansible-navigator doc.