Study guide · Core notes

RHCE: playbooks that rebuild a host

Reference notes for the EX294 study points reviewed on November 12, 2026. Each section names the file or command, and the check you run after a clean host and a reboot.

EX294 · current study pointsTen objective groupsReviewed November 12, 2026

How to read these notes: Unmarked items sit on the published EX294 study points. Items tagged Extra are older bullets or job context that list does not require. New to the exam? Start with the overview. RHCSA tasks are still in scope; the command reference for those tasks is on the RHCSA notes. Practice on systems you can rebuild. Do not put real passwords or private keys in a playbook you might share.

RHCSA tasks and shell scripts

The study points start with the administrator tasks, then ask you to read a script.

What is still in scope

Essential tools, running systems, local storage, file systems, deploy and maintain, users, and security. If you cannot do the task by hand, you cannot yet judge a playbook that claims to do it. Use the RHCSA path for those commands.

Read the script

A for loop over package names becomes a package list or a loop. An if [ -f file ] test becomes stat plus when. useradd fails the second time. ansible.builtin.user with state: present does not.

What the current bullet does not say

The page says analyze simple shell scripts. It does not say to write wrapper scripts that call ad hoc commands. That older bullet is not the list these notes follow.

Ad hoc commands Extra

ansible web -m ping is a fast connectivity check. It is useful in a lab. It is not a named bullet on the page reviewed on November 12, 2026. The graded object is the playbook applied to a fresh system.

Ansible components

Inventory, modules, variables, facts, plays, and failure.

Inventory versus playbook

The inventory names hosts and groups. The playbook lists plays and tasks. inventory_hostname is the name you wrote. A discovered hostname is a fact and can differ when the inventory uses an alias.

Modules and facts

A module is the action, named with a collection: ansible.builtin.dnf, ansible.builtin.copy. Facts come from gathering on the managed node. Read them as ansible_facts. register saves a module result, including changed and, for command, rc.

Loops and conditionals

loop repeats a task. item is the default loop variable. when: saved.rc == 0 is the test. Do not wrap the whole test in an extra {{ }}.

Look it up

Internet is not provided. ansible-navigator doc ansible.posix.firewalld -m stdout reads documentation that is already on the system. ansible-navigator collections lists the collections you can use.

ansible.cfg and navigator

Two files, two runners.

ansible.cfg

With ANSIBLE_CONFIG unset, Ansible reads ./ansible.cfg, then ~/.ansible.cfg, then /etc/ansible/ansible.cfg. Set inventory under [defaults]. Its relative path is resolved from the configuration file Ansible actually loaded. Use ansible-config dump --only-changed to inspect the effective setting.

Privilege escalation

[privilege_escalation] can set become, become_method, and become_user. A play can still set become: true. The remote user needs a sudoers rule on the managed node. Escalation does not run on the control node.

ansible-navigator.yml

This file configures navigator, including execution-environment.image and mode. pull.policy: missing uses a local image and does not require a registry. ansible-playbook does not read this file.

Both commands

ansible-navigator run site.yml -m stdout prints tasks in the terminal. The default navigator mode is the text interface. ansible-playbook site.yml runs with the control-node environment. A collection can exist in one environment and not the other.

Managed nodes

Static groups, SSH keys, and files.

Static inventory

web1 ansible_host=192.0.2.11 keeps the inventory name and sets the address. [web:children] nests groups. group_vars/web.yml applies to the group. host_vars override that group value for one host.

SSH keys

ssh-keygen creates the pair. The public key belongs in authorized_keys. The directory should be mode 700 and the file mode 600, owned by the remote user. A rebuilt host may have a new host key. Verify its fingerprint through a trusted lab channel before replacing the old known_hosts entry. Do not turn off host-key checking to hide an unexplained mismatch.

Copy versus template

ansible.builtin.copy places bytes unchanged. ansible.builtin.template renders Jinja first. ansible.builtin.file creates a directory or sets mode and ownership. ansible.builtin.fetch copies a file back to the control node.

Variable scope

Extra vars from -e beat group vars. Group vars beat role defaults in defaults/main.yml. Variables in vars/main.yml beat group vars. Use defaults when a play should be able to override the role.

Running and checking

Syntax, limits, and check mode.

--syntax-check

ansible-playbook site.yml --syntax-check parses the playbook and does not log in. Use it before you spend time on a host error.

--check and --limit

--check asks modules what they would change and does not leave that state applied. --limit web selects hosts. --tags selects tagged tasks. They are not the same switch.

Handlers

A changed task can notify a handler. The handler runs once at the end of the play. An ok task does not notify. meta: flush_handlers runs pending handlers before the next task.

Failure

ignore_errors: true continues the play, and the task still counts as failed. rescue runs when a task in the block fails. always runs either way. failed_when: false means the task is not a failure. changed_when is how a command task stops reporting a change on every run.

Git and the editor

The study points name clone, add, and three editor tasks.

Clone and add

git clone copies a repository. git add playbook.yml stages the file. It does not push. Commit, then push. An untracked file is absent from the remote until that sequence finishes.

Editor tasks

The page says to create playbooks and push them from VS Code, configure ansible-navigator, and run playbooks in an Ansible development container. Those are the same project files the CLI uses. The editor does not grade the exam.

What the container can see

The image has its own collections. A role that exists only in the editor home directory is invisible unless that directory is in the project the container mounts. Keep roles inside the project path.

No public network

Use the Git remote the lab provides. Do not assume a public host is reachable. The same limit applies to pulling a new container image and to downloading a collection.

Roles and collections

Reuse tasks, and name the collection.

Role layout

roles/web/tasks/main.yml holds tasks. handlers/main.yml holds handlers. templates/ holds Jinja sources. files/ holds files for copy. defaults/main.yml is easy to override. vars/main.yml is not.

Calling a role

A play can list roles. import_role is static and is processed when the playbook is parsed. include_role is dynamic, so when can skip it at runtime.

Fully qualified names

ansible.builtin.copy and ansible.posix.firewalld name the collection. A short name works only when that collection is on the search path. The qualified name does not depend on the path.

Install from what is available

ansible-galaxy collection install -r requirements.yml installs the collections named in the file, from a source the system can already reach. ansible-galaxy role install -r requirements.yml -p roles installs roles. The exam page does not provide internet access.

Administration modules

Desired state, not a one-shot shell line.

Packages and services

ansible.builtin.dnf with state: present installs and stays ok when the RPM is already there. state: latest upgrades. ansible.builtin.service needs state: started for now and enabled: true for the next boot.

Firewall and mounts

ansible.posix.firewalld with permanent: true saves the rule. immediate defaults to false in that case, so set immediate: true to change the running firewall too. On the mount module, mounted writes fstab and mounts. present writes fstab only.

Users, cron, and units

ansible.builtin.user with append: true adds supplementary groups. Without append, the list replaces them. ansible.builtin.cron uses name so a second run updates one entry. A new unit file needs daemon_reload: true on ansible.builtin.systemd before enable and start.

Archives and modes

ansible.builtin.unarchive with remote_src: false copies the archive from the control node. Quote modes as "0644" so YAML does not treat them as a number. One file should have one writer: do not template a file and then edit it with lineinfile on every run.

Templates and Vault

Rendered files, and secrets that stay encrypted in the project.

template

ansible.builtin.template renders {{ http_port }} and {% for %} blocks, then writes the result. In a role, src is relative to templates/. copy will leave the braces in the file.

Vault

A file that starts with $ANSIBLE_VAULT;1.1;AES256 is ciphertext. ansible-vault encrypt group_vars/all.yml creates it. Run with --ask-vault-pass or a password file the lab names. Do not commit the password beside the ciphertext.

What decryption is not

become does not decrypt variables. Removing the header does not turn ciphertext into keys. A lab that still has the plaintext file has not tested the exam copy of the project.

Notify after a render

A template task that changes a config should notify the handler that restarts the service. If the template reports ok, the handler does not run. That is what you want when the file is already correct.

Six checks on a disposable lab

Say what you expect to see before you run the playbook. Then rebuild or reboot and say what should still be true.

A playbook on a clean host

Run a play that installs and enables a service. Snapshot the managed node back to a system that does not have that package. Run the same playbook.

What to verify: the package and the enabled unit exist after the second run. A play that only worked because you had installed the package by hand fails this check.

Both runners

Run the project with ansible-navigator run and with ansible-playbook.

What to verify: both commands find the inventory and the collections the tasks name. If only one succeeds, the execution environment and the control node do not match.

A firewall that survives reboot

Enable the http service with permanent: true and immediate: true. Compare firewall-cmd --list-all with the permanent list. Reboot.

What to verify: http is in both lists before the reboot and still in the running list after it. permanent: true alone leaves immediate false, so the running firewall can lag behind the saved one.

A handler that runs once

Notify the same restart handler from two changed tasks. Then run the play again when nothing changes.

What to verify: the handler ran once on the first play, and it did not run on the second play. An ok template does not notify.

A role you can override

Put port: 80 in defaults/main.yml and port: 8080 in group_vars. Render a template.

What to verify: the file contains 8080. Move the same key to vars/main.yml and confirm the role value now wins. -e port=9090 wins over both.

Vault without the password in Git

Encrypt a variable file, commit the ciphertext, and leave the password out of the repository. Run the playbook with --ask-vault-pass.

What to verify: the run fails with no password and succeeds when you supply it. git grep does not find the plaintext secret.

Frequently asked questions

Which study points do these notes follow?

These notes follow the EX294 study points on the page reviewed on November 12, 2026, including ansible-navigator, ansible-playbook, Git, and VS Code. Items tagged Extra are older bullets or job context that list does not require.

Do the notes replace the official study points?

No. Use them with the published EX294 study points and the product documentation on the system you practice on. The exam does not provide internet access.

Do older Galaxy and ad hoc lists still match?

No. Those lists describe earlier objectives. The current page adds navigator, Git, and VS Code, and it says to install roles and content collections that are available. Ad hoc commands are marked Extra here.

Continue the RHCE study path

Use the notes, then test recall with cards and a timed practice set.

RHCE hub →
Available

Overview

Exam format, the current study points, and a lab plan.

Available · You are here

Core Notes

Reference notes for inventories, navigator, roles, collections, and Vault.

Available

Practice Exams

300 original questions with custom exams, explanations, and a practice percentage.

Official technical sources

Start with the EX294 study points. Course scope for this generation is on the AU294 page. Runner and platform behavior is in the Ansible Automation Platform 2.6 documentation. Confirm module parameters with ansible-navigator doc on the system you practice on.

RHCSA

Practice the EX200 tasks this exam still expects you to perform and to automate.

LPIC-2

Compare a vendor-neutral advanced Linux exam with this Ansible performance exam.

Apply concepts in the Scenario Workshop →