Ansible Tasks Level 1 Test inconsistencies

Dear KodeKloud,

I was taking Ansible Tasks Level 1 Test in kodekloud engineer and faced issue where task validation fails.

Here will be task

The Nautilus DevOps team is was doing some cleanup work on all app servers in Stratos DC. Instead of doing this manually they want to utilise Ansible for the same. Below are the requirements team has received.

a. Utilise the inventory file /home/thor/playbook/inventory-t4q4, present on the jump host.

b. Create a playbook name /home/thor/playbook/playbook-t4q4.yml to delete a file named /opt/fruits-t4q4.txt from all App Servers.

Note: Validation will attempt to execute the playbook using the command ansible-playbook -i inventory-t4q4 playbook-t4q4.yml. Please ensure the playbook functions correctly with this command alone, without requiring any additional arguments.

Here will be playbook task

  hosts: all
  become: True
  tasks:
     - name: delete
        ansible.builtin.file:
           path: /opt/fruits-t4q4.txt
           state: absent

Here will be inventory

Here will be screenshot of proof that the file really doesn’t exist on server stapp01 and also I did run playbook manually and it’s completed fine.

Tried to run validation few times, always failed.

Hi @r.saulitis

Can you share the review link of the task?

@Santosh_KodeKloud Funny but there is no review on TESTS.