Courseiva

EX294 Implement advanced Ansible automation Practice Question

Exhibit

# ansible-doc -t lookup fileglob
> FILEGLOB    (/usr/lib/python3.9/site-packages/ansible/plugins/lookup/fileglob.py)

# cat lookup_usage.yml
- name: Copy config files
  copy:
    src: "{{ item }}"
    dest: /etc/app/
  with_fileglob:
    - "/tmp/configs/*.conf"

# ls /tmp/configs/
server1.conf  server2.conf  server3.conf  server4.conf

# ansible-playbook lookup_usage.yml -l host1
TASK [Copy config files] *******************************************************
ok: [host1] => (item=/tmp/configs/server1.conf)
ok: [host1] => (item=/tmp/configs/server2.conf)
ok: [host1] => (item=/tmp/configs/server3.conf)
ok: [host1] => (item=/tmp/configs/server4.conf)

Refer to the exhibit. The playbook copies all .conf files from the control node to host1. If the playbook runs again on the same host without any changes, which task status is expected?

⚠ Common exam trap

The trap is assuming that re-running a copy task always reports `changed` or `skipped` — candidates forget that Ansible's checksum-based idempotency produces `ok` for identical files.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

All items will show 'ok' because files are identical.

Ansible's `copy` module is idempotent: when the source and destination files are identical (same content and checksum), the module reports `ok` rather than `changed`. On a second run with no source changes, all items in the loop will show `ok` because Ansible compares checksums and determines no copy is needed. This is the core idempotency guarantee of Ansible modules.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    The task will fail because the destination directory already contains files.

    Why it's wrong here

    Copy overwrites the destination file by default; pre-existing files cause no failure. Failure arises only from permission, path or checksum errors. It is tempting because some modules refuse to clobber existing targets, but copy's default force=yes replaces them, reporting 'ok' when content is identical.

  • ✓

    All items will show 'ok' because files are identical.

    Why this is correct

    The copy module compares checksums, so identical .conf files on host1 produce no transfer and report 'ok'. This satisfies the stem's constraint of a second run with no changes, where idempotence means unchanged state yields 'ok' rather than 'changed'.

  • ✗

    The task will be skipped because the files already exist.

    Why it's wrong here

    Copy overwrites existing files and reports 'ok' when checksums match; it does not skip existing destinations. Skipping occurs only with force=no or a when condition. It is tempting because file module with state=absent or command with creates genuinely skips, but copy always evaluates the destination.

  • ✗

    All items will show 'changed'.

    Why it's wrong here

    The copy module compares source and destination checksums; unchanged files report 'ok', not 'changed'. 'Changed' appears only when content, ownership or permissions differ. It is tempting because copy does report 'changed' on the first run, when files are actually transferred to the managed host.

About these practice questions

This EX294 question is part of Courseiva's 392-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Red Hat exam blueprint

This EX294 practice question is part of Courseiva's free Red Hat certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the EX294 exam.