Ansible blockinfile module - task failed

Hello everyone,
@Inderpreet @player001 @kodekloud-support3 @KodeKloud, any idea what has gone wrong? can you please check this for once at least and let me know what have i done wrong?

thor@jump_host ~/ansible$ sudo ansible-playbook -i inventory playbook.yml

PLAY [all] ************************************************************************

TASK [Gathering Facts] ************************************************************
ok: [stapp01]
ok: [stapp02]
ok: [stapp03]

TASK [Install all the packages] ***************************************************
ok: [stapp02]
ok: [stapp01]
ok: [stapp03]

TASK [restart and enable httpd] ***************************************************
ok: [stapp03]
ok: [stapp02]
ok: [stapp01]

TASK [Insert/Update HTML after line] ***************************************
ok: [stapp03]
ok: [stapp01]
ok: [stapp02]

TASK [Change file ownership, group and permissions] *******************************
ok: [stapp02]
ok: [stapp03]
ok: [stapp01]

PLAY RECAP ************************************************************************
stapp01 : ok=5 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
stapp02 : ok=5 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
stapp03 : ok=5 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0

reason why task failed :

something is wrong with playbook as ‘/var/www/html/index.html’ file does not contain correct data on App Server 1

Hello, nashwan
I think you haven’t added content properly. Can i see image of content in the given question?

Hello @player001
The content is one for every task. What you see in my answer is exactly, i copied and pasted there. what i have been asked to add

But i can’t see “!” in the end of Nautilus statement.

@player001 wow thats correct but at the same time not fair to loose point on such silly thing.
@Inderpreet @kodekloud-support3 @KodeKloud
Can this be marked as success please?

@nashwan Sorry but this can’t be marked Success as the failure seems valid.

Hi @Inderpreet,
I have this task also failed for me.
Please take a look at this, I think that I made everything as it should be.



I think the question says not to use any custom or empty marker for blockinfile module and in your playbook you have used marker. It may be one of the reason for failure.

ah, really. I think I understood it backwards.
My fault. Thanks.

Hi @Inderpreet ,
can you check this even though it was created with requested permissions , the task failed with wrong permissions on Folder.