Limited-Time Offer: Enjoy 50% Savings! Coupon code: 50OFF Use it at checkout
Skip to content

Free RedHat Red Hat Certified Engineer (RHCE) exam for Red Hat Enterprise Linux 8 Exam EX294 Exam Questions

Last updated: · 13 practice questions with answers and explanations

Page: 1 / 6 Total 35 questions

Want more questions? Get Premium Access.

Question 1

New Single answer

Topic: Understand core components of Ansible

Skill tested: Uses registered command results and conditionals to control Ansible task execution.

A fleet-maintenance playbook must run a vendor-provided diagnostic command on each managed host, then create `/var/tmp/maintenance-needed` only when that command reports that maintenance is due. The command returns a nonzero status when maintenance is not due, but that outcome is expected and must not mark the host failed. The command's output includes the phrase `maintenance required` when action is needed. Which task design meets these requirements without relying on a fact from a different host?

Correct Answer: C. Register the command result, use `failed_when: false` for the command, and condition the file task on the registered result's stdout containing the phrase.
Explanation:

Registering the result makes the command's stdout available to later tasks for the same host. Setting `failed_when: false` prevents the expected nonzero return code from aborting the play, while the file task's `when` condition can inspect the returned text. `ignore_errors` suppresses failure but does not make an unrelated fact contain command output. `changed_when` controls change reporting, not failure, and the stated nonzero status is not a reliable trigger for the required phrase. A handler runs only after notification and is not a substitute for evaluating the diagnostic output.

Question 2

New Multiple answers

Topic: Install and configure an Ansible control node

Skill tested: Configures inventory host groups, privilege escalation, and task parallelism for managed nodes.

An operations team has installed Ansible on a RHEL 8 control node. The team must target 18 web servers as a group, connect as the unprivileged account `automation`, and use privilege escalation for tasks that require root. The SSH account can use passwordless sudo on every server. A change window allows at most six hosts to be processed simultaneously, and engineers must be able to run a play against the `web` group without editing the playbook. Which two configuration choices satisfy these requirements? Select TWO.

Correct Answer: D. Define the servers under `[web]` in the static inventory and specify `ansible_user=automation` for the group.; E. Set `forks = 6` in `ansible.cfg` to limit the default number of concurrent worker processes.
Explanation:

A named `[web]` inventory group lets operators target the hosts with `-l web`, while `ansible_user=automation` selects the required SSH account. Setting `forks = 6` in the Ansible configuration limits the default parallel worker count. Privilege escalation can be requested in a play or configured through appropriate Ansible variables; it does not need to be a global configuration directive as described in B. `--limit 6` is not a host-count batching control, and `serial` is a play keyword rather than an `ansible.cfg` setting.

Question 3

New Single answer

Topic: Configure Ansible managed nodes

Skill tested: Diagnoses SSH connectivity and validates remote execution with Ansible ad hoc commands.

A new RHEL 8 host appears in the control node's inventory, but an ad hoc `ansible` command fails before executing the requested module. The error is an SSH authentication failure. The account named in `ansible_user` exists on the managed host, has a valid authorized shell, and is allowed to use sudo. Other hosts work with the same control-node key. The new host was provisioned from an image that does not include the team's public key. What should the administrator do first to establish the intended key-based connection and verify it?

Correct Answer: B. Install the control node's public key in the managed account's `~/.ssh/authorized_keys`, then run `ansible host -m ping`.
Explanation:

Ansible's normal SSH connection requires the control node's public key to be authorized for the remote account. Installing that public key in the account's `authorized_keys` addresses the reported authentication failure; the ad hoc `ping` module then verifies that Ansible can connect and execute Python-based module code. Sudo escalation happens after SSH authentication, so `become` cannot repair this failure. Managed nodes do not normally need the Ansible package installed. Copying the private key to a remote host exposes a credential and reverses the intended trust arrangement.

Question 4

New Single answer

Topic: Script administration tasks

Skill tested: Writes a shell wrapper that safely invokes an Ansible ad hoc command and reports failures.

A release engineer needs a small shell script that applies a temporary maintenance marker to every host in the `staging` inventory group. The script must stop if Ansible returns a failure, preserve the command's exit status for the calling scheduler, and avoid splitting the inventory path if it contains spaces. Which implementation is the best fit?

Correct Answer: D. `ansible staging -m file -a 'path=/var/tmp/maintenance state=touch' -i "$1" || exit $?`
Explanation:

Quoting `"$1"` keeps an inventory path containing spaces as one argument. The `|| exit $?` branch runs only if Ansible fails and exits with the same nonzero status, so a scheduler can detect failure. The file module is idempotent and expresses the desired state directly. A leaves the path unquoted and continues after failure; C always masks failure with a successful exit code; D uses a shell-like operation through the command module and prints the status without returning it as the script's status.

Question 5

New Multiple answers

Topic: Create Ansible plays and playbooks

Skill tested: Uses task ordering and Ansible error handling to recover from failed configuration changes.

A playbook changes a service's configuration and then restarts the service. If the restart fails, the host must be restored to its previous configuration, and the play must still report the failure. The backup must be made before changing the file, and a failed restart must not be hidden by recovery. Which two design choices best satisfy these requirements? Select TWO.

Correct Answer: C. Use a `block` for the change and restart, and make the `rescue` section restore the backup and then fail explicitly, for example with the `fail` module.; D. Use a `block` containing backup, configuration update, and restart tasks, with a `rescue` task that restores the backup.
Explanation:

A block can group the backup, change, and restart so a task failure enters `rescue`; the recovery task can restore the saved file. Ansible normally treats a successfully completed rescue as handled, so explicitly failing afterward preserves the requirement that the play report the restart problem. Ignoring the restart hides its failure, while an unconditional restore would undo successful changes too. A handler does not implement rollback, and `always` is for tasks that should run regardless of block outcome. `any_errors_fatal` stops execution across hosts but does not roll back files.

Question 6

New Single answer

Topic: Use Ansible modules for system administration tasks that work with: Software packages and repositories; Services; Firewall rules; File systems; Storage devices; File content; Archiving; Scheduled tasks; Security; Users and groups

Skill tested: Manages an RHEL 8 package repository and package installation declaratively with Ansible.

A disconnected RHEL 8 server must install an internally approved package named `acme-agent`. The repository metadata and RPMs are available from an internal HTTP repository, but the host has no subscription access and must not contact public repositories. Administrators want repeatable configuration that records the repository definition and installs the package without embedding a one-off shell command in the playbook. Which approach is most appropriate?

Correct Answer: D. Use the `yum_repository` module to define the internal repository, then use the `dnf` module to install `acme-agent`.
Explanation:

The `yum_repository` module manages a persistent repository definition, and the `dnf` module manages package state through the package manager. This approach uses the approved internal source and does not require subscription access or public repositories. A bypasses declarative module behavior and assumes repository configuration already exists. Downloading metadata alone does not install a package, and a service module cannot install RPMs. Setting a package to absent removes it rather than installing it.

Question 7

New Multiple answers

Topic: Use Ansible modules for system administration tasks that work with: Software packages and repositories; Services; Firewall rules; File systems; Storage devices; File content; Archiving; Scheduled tasks; Security; Users and groups

Skill tested: Configures a persistent local file system and its mount point with Ansible storage modules.

A RHEL 8 application server has an unused 20-GiB block device at `/dev/vdb`. It must be formatted as XFS, mounted at `/srv/appdata` after every reboot, and owned by the application service account after mounting. The device contains no data that must be preserved. The playbook must be safely rerunnable and should not invoke interactive disk utilities. Which three actions should the playbook perform? Select THREE.

Correct Answer: B. Use the `mount` module with `state: mounted`, `src: /dev/vdb`, `path: /srv/appdata`, and `fstype: xfs`.; D. Use the `file` module to create `/srv/appdata` with the required owner and mode after the mount task.; E. Use the `filesystem` module to create an XFS file system on `/dev/vdb`.
Explanation:

The filesystem module declaratively creates the XFS file system, and the mount module with `state: mounted` both mounts it now and ensures a persistent mount configuration. Applying file ownership after mounting ensures the permissions are set on the mounted file system's root rather than on the underlying mount-point directory. Ownership set only before mounting would be obscured by the mounted file system. Running `mkfs.xfs` unconditionally risks destroying data on later runs, and manually editing `/etc/fstab` falls short of the repeatable module-based configuration.

Question 8

New Multiple answers

Topic: Use Ansible modules for system administration tasks that work with: Software packages and repositories; Services; Firewall rules; File systems; Storage devices; File content; Archiving; Scheduled tasks; Security; Users and groups

Skill tested: Creates a least-privilege account and deploys its SSH public key idempotently.

A security team requires a dedicated account named `deploysvc` on a group of RHEL 8 servers. The account must have a home directory, must not receive a password that permits interactive login, and must accept a specific supplied SSH public key for automation. The account must not be added to `wheel`, and rerunning the playbook must not create duplicate account or key entries. Which two actions best implement the requirement? Select TWO.

Correct Answer: A. Use the `authorized_key` module with `user: deploysvc` and the supplied public key.; D. Use the `user` module to create `deploysvc` with a home directory and a locked password, without adding supplementary administrator groups.
Explanation:

The user module can ensure the account and home directory exist while locking its password, preventing password-based login without granting unnecessary administrator membership. The authorized_key module manages the specified public key in the account's authorized keys file and is idempotent, avoiding duplicate entries on reruns. Adding the account to `wheel` violates least privilege and is not needed for SSH key authentication. Repeated shell appends are not reliably idempotent, and an SSH public key is not an account password.

Question 9

New Single answer

Topic: Work with roles

Skill tested: Installs and invokes an Ansible Galaxy role through project dependencies.

A team has selected an existing Galaxy role for configuring a monitoring agent. The role is not installed on the control node, and deployments must be reproducible across team members and CI runners. The project repository should declare the role dependency so a clean environment can obtain it, and the playbook should apply it only to the `monitoring` host group. Which approach is most appropriate?

Correct Answer: C. List the role in `requirements.yml`, install it with `ansible-galaxy install -r requirements.yml`, and reference it under `roles` in a play targeting `monitoring`.
Explanation:

A project `requirements.yml` records the role dependency, and `ansible-galaxy install -r` retrieves the declared role on a clean control environment. Referencing the role under `roles` in a play scoped to `monitoring` applies it to the intended hosts. Ansible configuration files do not hold role task content. `ansible-galaxy init` scaffolds a new role rather than installing an existing one, and roles execute on the control node as part of Ansible playbook processing, not by installing them on managed hosts.

Question 10

New Single answer

Topic: Use advanced Ansible features

Skill tested: Renders host-specific configuration with a Jinja2 template and Ansible variables.

A platform team must deploy `/etc/app/worker.conf` to several RHEL 8 hosts. Every host uses the same configuration structure, but each requires a distinct worker name and backend address from inventory variables. The file must be managed so that reruns do not replace it unnecessarily, and administrators want the complete configuration to remain maintainable as a single source template. Which implementation best meets these requirements?

Correct Answer: A. Use the `template` module with a Jinja2 source file that references the per-host variables and writes to `/etc/app/worker.conf`.
Explanation:

The template module renders a Jinja2 source on the control node using each host's variables and manages the resulting file on that host. It is designed for customized configuration files and avoids replacing a file when rendered content has not changed. A single static copy cannot express different per-host values. `lineinfile` can manage individual lines, but it is a poor fit for maintaining a complete structured configuration from one source. Shell heredocs sacrifice module idempotence and make quoting and change detection harder.

Question 11

New Single answer

Topic: Use advanced Ansible features

Skill tested: Protects sensitive playbook data with Ansible Vault and supplies the vault credential securely.

A playbook needs a database password to create an application configuration file. The team requires the encrypted value to be stored in its version-controlled project, while the decryption credential must not be committed alongside it. Operators should be able to decrypt data only when they possess the separately controlled vault credential. Which design best satisfies this requirement?

Correct Answer: C. Encrypt the variable file with Ansible Vault, commit the encrypted file, and provide the vault password at execution time through an approved secure mechanism such as a protected password file or prompt.
Explanation:

Ansible Vault encrypts sensitive variable data so the encrypted file can be stored in version control without exposing its contents. The vault password remains a separate secret supplied at execution time, for example through a prompt or a suitably protected password file. Repository access controls alone do not encrypt plaintext credentials. Base64 encoding is reversible encoding, not encryption. Committing the vault password alongside the encrypted data would defeat the separation needed to decrypt it.

Question 12

New Single answer

Topic: Be able to perform all tasks expected of a Red Hat Certified System Administrator

Skill tested: Uses systemd service state and enablement to maintain a required service across reboots.

A RHEL 8 server hosts an internal reporting application. After a maintenance reboot, the application is unavailable because its systemd service remained stopped. The service unit is already installed and valid, and the application team requires it to start immediately and automatically at subsequent boots. No package or configuration changes are needed. Which action should the administrator take?

Correct Answer: D. Use `systemctl enable --now reportd` to enable the unit and start it immediately.
Explanation:

`systemctl enable --now` performs both required operations: enabling the unit for future boots and starting it immediately. Enabling alone changes boot-time activation but does not necessarily start a currently stopped service. Starting alone does not configure boot-time activation. Reload requests that a running service reload its configuration; it does not start or enable an inactive unit. The scenario explicitly rules out package or configuration work, so service state and enablement are the relevant controls.

Question 13

New Multiple answers

Topic: Be able to perform all tasks expected of a Red Hat Certified System Administrator

Skill tested: Uses standard shell tools to inspect and manage processes without disrupting unrelated services.

An administrator receives a report that one process is consuming excessive CPU on a production RHEL 8 host. The process name may occur more than once, and the administrator must identify the specific process before taking action. The host must remain available, and unrelated processes must not be terminated. Which two actions are appropriate? Select TWO.

Correct Answer: A. After identifying the affected PID, send it `SIGTERM` first and verify whether it exits before considering a stronger signal.; E. Use `ps` or `top` to inspect process IDs, CPU usage, and command details before deciding which process is responsible.
Explanation:

Inspecting process details first helps distinguish among processes with similar names and confirms which PID is consuming resources. Sending `SIGTERM` to that identified PID allows the process to shut down cleanly; the administrator can then verify its state and escalate only if necessary. An immediate broad `pkill -9` can terminate unrelated matching processes and prevents cleanup. PID 1 is the system's init process, not a safe target. Rebooting causes service disruption and avoids rather than diagnoses the problem.