EX294 Ansible Practice: Original Tasks With Verified Results

Practise EX294 by turning a written requirement into a playbook, checking its result and explaining a second run. The original exercise below creates a notice inside a newly assigned temporary directory, reads it back and verifies the text. Its syntax and two actual runs were checked with Ansible Core on Linux. It is a small localhost exercise, not an exam simulation or proof of readiness across Red Hat’s objectives.

Jan 25, 2025 - 15:20
Updated: 
102.1k

Ansible Automation in IT Infrastructure · Certification preparation

EX294 Ansible Practice: Original Tasks With Verified Results

Quick answer: Practise EX294 by turning a written requirement into a playbook, checking its result and explaining a second run. The original exercise below creates a notice inside a newly assigned temporary directory, reads it back and verifies the text. Its syntax and two actual runs were checked with Ansible Core on Linux. It is a small localhost exercise, not an exam simulation or proof of readiness across Red Hat’s objectives. Use the current EX294 page to plan the broader platform-specific practice you still need.

Key takeaways

  • Start with a required state and a way to verify it.
  • Keep this exercise inside a new temporary training directory.
  • Read the created file instead of relying only on a recap.
  • Use a second run to inspect repeated behaviour.
  • Keep a small community-Ansible test separate from full exam preparation.

Table of Contents

Which current exam should these practice tasks support?

Red Hat’s current EX294 page names the Red Hat Certified Advanced System Administrator in Ansible exam. Passing it earns that standalone award and contributes to the separate engineer pathway. The RHCE in Ansible page explains the RHCSA-plus-EX294 route. Check your credential status and the version available for the assessment you intend to book.

Use the detailed objectives to identify your learning gaps. This article concentrates on a small part of playbook work: an explicit input, a required file state and a check of the result. It does not reproduce protected assessment material. The tasks and sample text were created for this guide, so adapt them to practise reasoning rather than memorising a supposed exam answer.

What must the original notice exercise accomplish?

Use an assigned Linux training environment with Ansible available. Create a fresh directory with lab=$(mktemp -d /tmp/webasha-ansible-cycle09-XXXXXX) and keep that shell open for the later commands. The playbook’s path assertion checks the supplied string, not directory ownership or freshness, so this creation step matters. Do not substitute an existing project or system directory.

Write the acceptance conditions before looking at the solution. The file must contain the exact line “Training systems only” followed by a newline. It should have mode 0600. A repeated application should leave the same required state. The playbook guide explains desired state and repeated execution. The table separates the work from the evidence needed to check it.

Original taskRequired resultVerification
Validate the inputAn assigned temporary path is suppliedThe initial assertion accepts it
Create the noticenotice.txt has the required text and modeRead the file and inspect its metadata
Verify the textExact contents include the final newlineThe content assertion succeeds
Apply the same task againThe file remains correctSuccessful checks and no further file change

How does the checked playbook express those requirements?

Save this as exercise.yml in your training workspace. It targets localhost, uses the local connection and skips fact gathering. The path assertion precedes the file task. The notice is plain invented training text, with no password or confidential data.

---
- name: Build and verify a training notice
  hosts: localhost
  connection: local
  gather_facts: false
  tasks:
    - name: Require an assigned temporary workspace
      ansible.builtin.assert:
        that:
          - lab_dir is defined
          - lab_dir is match('^/tmp/webasha-ansible-cycle09-[A-Za-z0-9_-]+$')
    - name: Write the required notice
      ansible.builtin.copy:
        dest: "{{ lab_dir }}/notice.txt"
        content: "Training systems only\n"
        mode: "0600"
    - name: Read the resulting notice
      ansible.builtin.slurp:
        src: "{{ lab_dir }}/notice.txt"
      register: notice
    - name: Verify the required content
      ansible.builtin.assert:
        that:
          - (notice.content | b64decode) == "Training systems only\n"
        success_msg: "Notice content verified"

The copy module documentation describes file contents and metadata. The quoted mode keeps the permission value explicit. The slurp documentation describes reading file data into a returned result; its encoded content is decoded for the comparison. The assert documentation explains the expressions and success message. Each module has a specific role, making the check easier to review than a command that prints “done” regardless of the resulting file.

How should you run and inspect the exercise?

Record your new directory in the shell variable lab. Run ansible-playbook -i localhost, exercise.yml --syntax-check -e "lab_dir=$lab", then ansible-playbook -i localhost, exercise.yml -e "lab_dir=$lab". Retain the output and repeat the normal command against the same directory. In a standard installed environment, the entry point is ansible-playbook; the test harness used the equivalent Python CLI module with an isolated configuration.

The recorded test used Python 3.13.17 and Ansible Core 2.22.0 in an existing minimal Linux guest. Syntax checking exited successfully. The first actual run reported four successful tasks, one change and no failed or unreachable tasks. The content assertion printed “Notice content verified”. A separate file inspection also confirmed mode 0600 and the required bytes. The fixture was a new guest temporary directory; no remote managed node or system service was involved. These results establish this exercise’s behaviour in that environment, not compatibility with every exam or automation-platform version.

What does the second run prove, and what still needs checking?

The second actual run reported four successful tasks, zero changes and no failed or unreachable tasks. The content assertion succeeded again. That supports the expected repeated behaviour for the same input and starting result. It does not establish that every future input or every other task in a larger playbook is correct.

A recap is most useful alongside outcome checks. A task aimed at the wrong file might also report no changes if that wrong file already matched. Here, the explicit path and read-back assertion keep the intended object and text visible. Inspect the resulting permission mode as a separate acceptance condition. The displayed content assertion verifies text; it does not assert every piece of file metadata or prove a business service works.

How can you reason through useful follow-up questions?

Change one requirement at a time and write the expected result first. The following are proposed follow-up tasks with worked reasoning, not additional executed test results. Use a fresh assigned fixture for each attempt and keep the output if your prediction was wrong.

For example, a new notice requirement needs an update to both the desired content and the verification expression. If you change only the file task, the old assertion should expose the disagreement. If you change only the assertion, it should reject the old content. That makes the acceptance check part of the exercise rather than a decorative final step.

Follow-up questionWorked reasoning
What if lab_dir is missing?The initial assertion must stop before the file task
What if the required text changes?Update the desired text and its independent acceptance condition together
What if the wrong directory is supplied?Reject it rather than create a file outside the assigned path pattern
What if check mode predicts a change?Inspect support and task dependencies; prediction is not a completed write

How should this fit into broader EX294 preparation?

The check-mode documentation explains simulation support, task overrides and limitations involving prior results. Syntax checking, simulation and actual execution answer different questions. Do not present any one of them as a universal approval of an unfamiliar playbook. Read the tasks and their targets before running them.

After you understand this exercise, use the official objectives to plan practice with inventories, variables, roles, collections, templates and the required administration environment. Arrange permitted systems, appropriate reset access and review of the outcomes. Record which environment you used and which objectives remain untested. A useful study milestone is explaining why a result is correct and how you would detect a wrong one, without treating a successful toy task as a promise about an assessment result.

Related reading: practise a separate variable-and-plan exercise; evaluate practical course feedback.

If you want instructor feedback, ask WebAsha for a syllabus, supervised lab arrangements and written access terms before enrolling.

References

Frequently Asked Questions

The exercise and follow-up questions are original learning material, and they are not represented as protected exam content or a prediction of assessment tasks.

Red Hat currently names a standalone advanced system administrator award in Ansible, while the engineer designation follows its separate RHCSA-plus-EX294 pathway.

The checked normal run wrote a synthetic notice file inside a newly created guest temporary directory, with no remote host or system-service changes.

The recorded test used Python 3.13.17 and Ansible Core 2.22.0 on Linux, without claiming RHEL or Ansible Automation Platform exam equivalence.

A zero-change recap supports repeated behaviour for the tested state, while intended targets, content, metadata and wider service requirements still need verification.

Syntax checking is separate from actual execution, so it cannot establish that the required file was written or that its resulting contents are correct.

The syntax check and two normal runs were executed; the additional variations are labelled reasoning exercises rather than recorded test outcomes.

This small exercise covers a limited playbook workflow, while the broader official objectives and the selected assessment environment require separate practical preparation.

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Wow Wow 0
Sad Sad 0
Angry Angry 0
Aayushi Sinha

With a passion for staying on the cutting edge of technology trends, I am dedicated to delivering content that not only informs but also inspires. Whether you need in-depth analysis pieces, informative guides, or thought-provoking opinion pieces, I craft content that resonates with tech enthusiasts and professionals alike.