50 Most Asked RHCE Interview Questions (2027)
50 most asked RHCE interview questions for EX294: inventories, ansible.cfg, ansible-navigator, roles, collections, Vault, templates and RHCSA tasks.
The most asked RHCE interview questions test Ansible on Red Hat Enterprise Linux: inventories, ansible.cfg, ansible-navigator, playbooks, variables and facts, loops and conditionals, error handling, roles and collections, Jinja2 templates, Ansible Vault, and automating RHCSA tasks such as storage, firewall rules, services and users. This page has 50 questions with short answers, grouped by level.
The questions follow the published objectives for EX294, which Red Hat now names the "Red Hat Certified Advanced System Administrator in Ansible" exam. Answers were checked against redhat.com and the Ansible documentation in November 2026.
Key takeaways
- RHCE today is an Ansible credential. You earn it by holding RHCSA (EX200) and passing EX294.
- The EX294 objectives include
ansible-navigator,ansible-navigator.yml, basic Git, and working from VS Code with an Ansible development container, so expect questions on all of them. - Interviewers care about idempotence: run the play twice and the second run should report no changes.
- Know the fully qualified collection names (FQCN) of common modules, such as
ansible.posix.firewalldandcommunity.general.lvg. - Red Hat states that configurations must persist after reboot in its performance-based exams, and interviewers ask about persistence for the same reason.
Which RHCE page to read
This is the main RHCE question set. For the exam syllabus and study tips read RHCE on RHEL 10: EX294 syllabus and preparation tips. For hands-on troubleshooting use scenario-based RHCE questions, and for deeper material see advanced RHCE questions. If your RHCSA basics are rusty, start with the 120 RHCSA interview questions.
| EX294 objective area | Questions here |
|---|---|
| Core components and configuration | 1 to 14 |
| Plays, variables, facts, loops, conditionals, error handling | 15 to 28 |
| Roles, collections, templates, Vault | 29 to 36 |
| Automating RHCSA tasks, Git, navigator, design | 37 to 44 |
| Scenarios | 45 to 50 |
RHCE interview questions for freshers
1. What does the RHCE certification cover today?
RHCE covers automating Red Hat Enterprise Linux administration with Ansible. You need RHCSA (EX200) and must pass EX294, the Red Hat Certified Advanced System Administrator in Ansible exam. It is a hands-on exam: you complete tasks on live systems rather than answer multiple-choice questions.
2. What is Ansible, and why is it agentless?
Ansible is an automation tool that describes the desired state of systems in YAML playbooks. It is agentless because it connects to managed nodes over SSH (or WinRM for Windows) and runs modules there with Python, so you do not install or maintain an agent on each node.
3. What is a control node and a managed node?
The control node is the machine where Ansible is installed and where you run playbooks. Managed nodes are the hosts Ansible configures. Managed nodes need SSH access, a user Ansible can log in as, and Python for most modules.
4. What is an inventory?
An inventory lists managed hosts and groups. A static inventory is a file in INI or YAML format. Groups can contain other groups through :children, and you can attach variables to hosts or groups.
[web]
web1.example.com
web2.example.com
[db]
db1.example.com
[prod:children]
web
db
5. What are the implicit groups all and ungrouped?
all contains every host in the inventory. ungrouped contains hosts that belong to no group other than all. You can target them in a play without defining them.
6. In what order does Ansible look for ansible.cfg?
It uses the first file it finds in this order: the path in the ANSIBLE_CONFIG environment variable, ansible.cfg in the current directory, ~/.ansible.cfg, then /etc/ansible/ansible.cfg. Run ansible --version to see which file is in use.
7. What settings usually go in a project ansible.cfg?
The inventory path, the remote user, privilege escalation defaults and often the roles path and collections path:
[defaults]
inventory = ./inventory
remote_user = ansible
roles_path = ./roles
collections_path = ./collections
[privilege_escalation]
become = true
become_method = sudo
become_user = root
become_ask_pass = false
8. What is a module?
A module is a unit of code that performs one job on a managed node, such as installing a package or managing a service. Modules return JSON with fields like changed and failed. Most modules are idempotent: they change the system only when it is not already in the requested state.
9. What is the difference between an ad hoc command and a playbook?
An ad hoc command runs one module once from the command line, for example ansible web -m ansible.builtin.ping. A playbook is a YAML file with one or more plays and many tasks that you can version, review and rerun. Use ad hoc for quick checks and playbooks for anything you will repeat.
10. What is a play and what is a task?
A play maps a group of hosts to a list of tasks and settings such as become and variables. A task calls one module with arguments. A playbook contains one or more plays, run in order.
11. How do you find documentation for a module during the exam or at work?
Use ansible-doc, for example ansible-doc ansible.posix.firewalld, or browse with ansible-navigator doc. ansible-doc -l lists available modules. The EX294 objectives specifically expect you to look up module documentation with the provided tools.
12. What is ansible-navigator?
ansible-navigator is a command line and text user interface for running and developing Ansible content. It runs playbooks inside an execution environment (a container image with Ansible, collections and Python dependencies), so every run uses the same tooling. Use -m stdout to get output like ansible-playbook.
ansible-navigator run site.yml -m stdout
13. What goes in ansible-navigator.yml?
It sets navigator defaults such as the execution environment image, whether to pull it, the output mode and playbook artifact settings. Editing this file is listed in the EX294 objectives.
ansible-navigator:
execution-environment:
image: registry.redhat.io/ansible-automation-platform-25/ee-supported-rhel9:latest
pull:
policy: missing
mode: stdout
playbook-artifact:
enable: false
The image name above is an example; use the image your environment provides.
14. How do you set up SSH key access and privilege escalation for managed nodes?
Generate a key pair with ssh-keygen, distribute the public key (with ssh-copy-id or the ansible.posix.authorized_key module), and give the automation user sudo rights through a file in /etc/sudoers.d/. Then set become: true in ansible.cfg or the play.
RHCE interview questions for 2 to 5 years of experience
15. Where can you define variables, and which wins?
Variables can live in inventory, group_vars and host_vars directories, the play's vars and vars_files, role defaults and role vars, registered results, facts, and extra vars. Extra vars passed with -e have the highest precedence; role defaults have the lowest. In practice, keep defaults in roles and environment values in group_vars.
16. What are facts?
Facts are details Ansible gathers from managed nodes at the start of a play through the setup module: OS, IP addresses, memory, disks and more. Access them through ansible_facts, for example ansible_facts['distribution_major_version']. Set gather_facts: false to save time when you do not need them.
17. What are magic variables?
They are variables Ansible sets itself: inventory_hostname (the host's name in inventory), groups (all groups and members), group_names (groups of the current host) and hostvars (variables of any host). Templates often use hostvars and groups to build files such as /etc/hosts.
18. How do you capture command output and use it later?
Use register to save a task's result, then read fields such as stdout, rc or changed in later tasks:
- name: Check if httpd is enabled
ansible.builtin.command: systemctl is-enabled httpd
register: httpd_state
changed_when: false
failed_when: false
- name: Report state
ansible.builtin.debug:
msg: "httpd is {{ httpd_state.stdout }}"
19. How do loops work?
Use loop with a list and refer to each item as item. For lists of dictionaries, read fields like item.name. loop_control lets you rename the loop variable or set a label for cleaner output.
- name: Create users
ansible.builtin.user:
name: "{{ item.name }}"
groups: "{{ item.groups }}"
loop:
- { name: alice, groups: wheel }
- { name: bob, groups: developers }
20. How do conditionals work?
Add when with a Jinja2 expression without braces. Conditions can test facts, variables or registered results, and a list of conditions means all must be true.
- name: Install on RHEL 9 or later only
ansible.builtin.dnf:
name: cockpit
state: present
when: ansible_facts['distribution_major_version'] | int >= 9
21. What are handlers?
Handlers are tasks that run only when notified by a task that reported a change, and they run once at the end of the play by default, even if notified several times. The usual example is restarting a service after its configuration file changes. Use meta: flush_handlers if you need them to run earlier.
22. How do you handle task failure?
Use ignore_errors: true to continue after a failure, failed_when to define failure yourself, and block with rescue and always for structured error handling:
- block:
- name: Apply new config
ansible.builtin.template:
src: app.conf.j2
dest: /etc/app/app.conf
rescue:
- name: Restore previous config
ansible.builtin.copy:
src: /etc/app/app.conf.bak
dest: /etc/app/app.conf
remote_src: true
always:
- name: Log result
ansible.builtin.debug:
msg: "Config step finished"
23. What is the difference between changed_when and failed_when?
changed_when decides whether a task reports "changed"; it is often set to false on read-only commands so the play stays idempotent in reports. failed_when decides whether a task fails, for example when output contains a specific error even though the return code was zero.
24. Why should you avoid command and shell where a module exists?
command and shell always report changed unless you tell them otherwise, are not idempotent by default, and hide intent. A dedicated module (for example ansible.builtin.dnf instead of dnf install) checks state first and reports accurately. Use creates or removes if you must run a command.
25. How do you limit a run to some hosts or tasks?
Use --limit to restrict hosts, --tags and --skip-tags to select tasks, and --start-at-task to resume at a named task. --check runs in check mode and --diff shows file changes. These work with both ansible-playbook and ansible-navigator run.
26. What is the difference between import and include?
import_tasks and import_playbook are static: processed when the playbook is parsed, so tags and conditions apply to each imported task. include_tasks is dynamic: processed when reached at run time, so it can use loops and variables computed earlier.
27. How do you check playbook syntax before running it?
Run ansible-playbook --syntax-check site.yml or the equivalent with navigator, then a --check --diff run against a test host. ansible-lint adds style and best practice checks if it is available in your environment.
28. How do you run tasks on one host only, or one host at a time?
run_once: true runs a task on the first host in the batch. delegate_to runs a task on another host (for example, a load balancer). serial at play level controls how many hosts are processed at once, which is how you do rolling updates.
29. What is a role and what is its directory structure?
A role packages tasks, handlers, templates, files, variables and defaults so they can be reused. Create one with ansible-galaxy role init. The main folders are tasks/, handlers/, templates/, files/, vars/, defaults/ and meta/, each with a main.yml where applicable.
30. How do you install roles and collections from a requirements file?
ansible-galaxy role install -r roles/requirements.yml -p roles
ansible-galaxy collection install -r collections/requirements.yml -p collections
The requirements file lists names, versions and sources. On Red Hat systems the source can be Red Hat Automation Hub or a private hub configured in ansible.cfg.
31. What is an Ansible Content Collection?
A collection is a distribution format that bundles modules, roles, plugins and playbooks under a namespace, such as ansible.posix or community.general. You call content by its FQCN, for example ansible.posix.mount, which avoids name clashes between collections.
32. What are RHEL System Roles?
RHEL System Roles are Red Hat supported roles for common configuration, such as time sync, SELinux, storage, network and firewall. They ship as the rhel-system-roles package (and as a collection), and give you a consistent interface across RHEL versions.
33. How do Jinja2 templates work in Ansible?
The ansible.builtin.template module renders a .j2 file with variables and facts, then copies the result to the managed node. You can use loops, conditionals and filters inside the template.
# {{ ansible_managed }}
{% for host in groups['web'] %}
{{ hostvars[host]['ansible_facts']['default_ipv4']['address'] }} {{ host }}
{% endfor %}
34. What are some filters you use often?
default to supply a fallback, int and bool for type conversion, join and split for strings, password_hash for user passwords, and selectattr or map to pick items from lists. Filters run on the control node.
35. How do you protect secrets with Ansible Vault?
Encrypt variable files with ansible-vault create or ansible-vault encrypt, edit with ansible-vault edit, and run playbooks with --ask-vault-pass or --vault-password-file. Keep the password file out of Git with tight permissions.
ansible-vault create group_vars/prod/vault.yml
ansible-playbook site.yml --vault-password-file ~/.vault_pass
36. How do you use different Vault passwords for different environments?
Use vault IDs: encrypt with --vault-id prod@prompt or --vault-id dev@~/.vault_dev, and pass the matching IDs at run time. This keeps a developer's password from opening production secrets.
RHCE interview questions for senior engineers
37. How do you automate storage tasks such as partitions, LVM and mounts?
Use community.general.parted for partitions, community.general.lvg and community.general.lvol for LVM, community.general.filesystem to create the file system, and ansible.posix.mount with state: mounted so the mount is active and written to /etc/fstab. The RHEL storage system role is an alternative.
38. How do you manage firewall rules so they persist?
Use ansible.posix.firewalld with both permanent: true and immediate: true, so the rule applies now and after a reboot:
- name: Allow HTTPS
ansible.posix.firewalld:
service: https
permanent: true
immediate: true
state: enabled
39. How do you manage SELinux with Ansible?
Set the mode with ansible.posix.selinux, booleans with ansible.posix.seboolean (use persistent: true), file contexts with community.general.sefcontext followed by a restorecon step, and ports with community.general.seport. The RHEL SELinux system role covers the same tasks.
40. How do you manage packages, repositories, services and scheduled jobs?
Use ansible.builtin.yum_repository to define repositories, ansible.builtin.dnf for packages, ansible.builtin.service or ansible.builtin.systemd with enabled: true and state: started for services, and ansible.builtin.cron for scheduled jobs. Enabling the service is what makes it survive a reboot.
41. How do you use Git in an Ansible workflow?
Keep playbooks, roles, inventory and requirements in a Git repository. Clone it, add and commit changes, and push to a shared remote for review. EX294 lists cloning a repository and adding files, and the objectives also expect you to push playbooks from VS Code.
git clone https://git.example.com/infra/ansible.git
git add roles/web
git commit -m "Add web role"
git push
42. What is an Ansible development container in VS Code?
It is a container that holds Ansible tools, so VS Code opens the project inside a consistent environment. With the Ansible extension you can edit playbooks with linting and completion and run them through ansible-navigator. EX294 lists running playbooks with an Ansible development container from VS Code.
43. How do you structure a large Ansible project?
Separate inventories per environment, keep variables in group_vars and host_vars, put logic in roles with sensible defaults, pin collection versions in requirements files, and keep one short site playbook that imports per-tier playbooks. Review changes through pull requests and test in a non-production inventory first.
44. How do you speed up long playbook runs?
Raise forks in ansible.cfg, disable fact gathering where you do not need facts or cache facts, use SSH pipelining where sudo settings allow it, avoid loops that call a module once per item when the module accepts a list (for example passing a list to dnf), and use async for long independent tasks.
Scenario-based RHCE interview questions
45. A playbook reports "changed" every run even though nothing changes. How do you fix it?
Find the tasks that report changed. Usually they are command or shell tasks; replace them with modules, or add creates, removes or changed_when. Check templates for content that changes each run, such as timestamps. Then run twice and confirm the second run shows changed=0.
46. Ansible says "Permission denied (publickey)" for one host. What do you check?
Check the remote user in the inventory or ansible.cfg, confirm the public key is in that user's authorized_keys with correct permissions, test with plain ssh from the control node, and run with -vvv to see which key and user Ansible tries. With navigator, make sure the execution environment can reach your SSH key or agent.
47. A task fails with "Missing sudo password". What happened?
The automation user needs a password for sudo, but none was given. Either configure passwordless sudo for that user in /etc/sudoers.d/ or run with --ask-become-pass. Check that become is set where it is needed rather than globally if some tasks must run as the normal user.
48. A module is "not found" when you run with ansible-navigator but works with ansible-playbook. Why?
Navigator runs inside an execution environment, which may not contain the collection installed on your control node. Install the collection into the project collections directory, use an execution environment that includes it, or point navigator at the right image in ansible-navigator.yml. Browse available collections with ansible-navigator collections.
49. A mount created by your playbook disappears after reboot. What went wrong?
The task probably used state: ephemeral or a command: mount call, so nothing was written to /etc/fstab. Use ansible.posix.mount with state: mounted. Also check that the logical volume and file system tasks run before the mount task and that the device name is stable, ideally by UUID.
50. You must change a config file on 200 web servers without downtime. How do you do it?
Use a role with a template and a handler that reloads the service, set serial to a small batch size, take each batch out of the load balancer with a delegated task, apply and verify with ansible.builtin.uri, then return it. Set max_fail_percentage so a bad change stops the rollout early.
How to prepare for an RHCE interview
- Build a lab with one control node and three managed RHEL nodes (Red Hat offers a no-cost developer subscription).
- Write playbooks for each RHCSA task area: packages, services, firewall, storage, users, SELinux, cron and archives.
- Run everything with both
ansible-playbookandansible-navigator. - Turn repeated tasks into roles, add a requirements file and keep the project in Git.
- Reboot your managed nodes and confirm every change persisted.
For production-style examples see 15 Ansible playbooks used in production, and for wider DevOps rounds the 200+ DevOps interview questions hub. Our RHCE training follows the EX294 objectives in our Kharadi, Pune classroom and live online; pair it with RHCSA training if you still need EX200.
Official references
- Red Hat EX294 exam page and objectives
- Red Hat Certified Engineer (RHCE) certification
- Red Hat EX200 (RHCSA) exam
- Ansible documentation
- Ansible configuration settings
- Using variables and precedence
- Ansible Navigator documentation
- Red Hat Developer subscription for RHEL
FAQs
Is RHCE still a Linux administration exam?
RHCE is now Ansible focused. You need RHCSA for the core Linux skills, and EX294 tests automating those tasks with Ansible.
What is the current name of the EX294 exam?
Red Hat's exam page names EX294 the "Red Hat Certified Advanced System Administrator in Ansible" exam. Passing it with a current RHCSA earns the RHCE credential.
Do I need to know ansible-navigator for RHCE?
Yes. The EX294 objectives include running playbooks with ansible-navigator, editing ansible-navigator.yml, and using it to find modules and collections.
Which Red Hat courses prepare you for EX294?
Red Hat recommends RH124 and RH134 (or RH199) for RHCSA skills and AU294, Red Hat Enterprise Linux Automation with Ansible, for the exam itself.
How many RHCE questions should I prepare for an interview?
Know the 50 here well, and practise them in a lab. Interviewers often ask you to write a short playbook live.
Are Git and VS Code really part of EX294?
Yes. The objectives list cloning a repository, adding files, and creating playbooks and pushing them to Git from VS Code.
Does RHCE expire?
Red Hat certifications are considered current for a limited period. Check the RHCE page on redhat.com for the current rules before you plan renewal.
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Angry
0
Sad
0
Wow
0