Ansible Copy Module - Failed

@kodekloud-support3 @Ayman @Inderpreet @mmumshad,
Kindly check my Aisible copy module. I have got the expected out put but still task failed. Kindly let me what is the error.

hor@jump_host ~/ansible$ ansible all -i inventory -m command -a “ls -l /opt/security/index.html”
stapp02 | CHANGED | rc=0 >>
-rw-r–r-- 1 root root 35 Aug 3 12:24 /opt/security/index.html
stapp03 | CHANGED | rc=0 >>
-rw-r–r-- 1 root root 35 Aug 3 12:24 /opt/security/index.html
stapp01 | CHANGED | rc=0 >>
-rw-r–r-- 1 root root 35 Aug 3 12:24 /opt/security/index.html

hor@jump_host ~/ansible$ cat inventory
stapp01 ansible_host=172.16.238.10 ansible_ssh_user=tony ansible_ssh_pass=Ir0nM@n
stapp02 ansible_host=172.16.238.11 ansible_ssh_user=steve ansible_ssh_pass=Am3ric@
stapp03 ansible_host=172.16.238.12 ansible_ssh_user=banner ansible_ssh_pass=BigGr33n

Can anyone please check above request and update

Okay, Can i see your playbook file?

thor@jump_host ~/ansible$ cat playbook.yml

  • name: copy file
    hosts: all
    tasks:
    • name: copy module
      copy:
      src: /usr/src/security/index.html
      dest: /opt/security/index.html

Kindly update on my Ansible copy module task issue

Hi @nithyaks Apologies for delayed response, seems like it failed for you because you added a custom ansible.cfg in your working directory. However was running from from different location in validation and it wasn’t able to use your ansible.cfg hence failed.

We have made some changes there, please give it an another try.

we need to run the playbook where our inventory file exist. So i created ansible.cfg created to use privillege escalation properties.

Again my task failed. This time i never used ansible.cfg but still task failed. Kindly check on it

@nithyaks Its not mandatory to run the playbook from the location where inventory file exits. However the issue is fixed now so it should work with or without a custom ansible.cfg file. I didn’t see any error for you failed task this time, did you see any error message after submitting the task ? Anyways based on your answer I marked it Success for you.

Thank you. It never show any other error. just show task failed

@Inderpreet @kodekloud-support3 @Ayman

Task failed without any errors! , files were successfully copied to all app host servers.
PFA screenshot for reference.


@Narendra096 it can be marked Success for you. Was it your today’s task or old one ?

Yes @Inderpreet , I got this today itself.
But still it is showing failed to me.

@Narendra096 should be Success now.

@Inderpreet @kodekloud-support3 @Ayman

My task was also failed without errors!, all the files were successfully copied to all the application servers.


@Inderpreet @Tej-Singh-Rana
Hi Guys,
I too getting the task as failed, but i did correctly. Also it’s not showing any error messages. Please check and let me know.
Below i have attached the screenshot for reference.

@Inderpreet @Ayman @kodekloud-support3 @rahul456
Hi
Anybody please check on this? This task was assigned by yesterday.

Hello, Surendar
Don’t worry KKE team will look. In the above, discussion on the errors. Have you customize your ansible.cfg file?

@Inderpreet @kodekloud-support3

Any updates on this issue here?

I’m not yet customize my config file.
All things i did mentioned at my inventory file like:
[app]
172.16.238.10 ansible_user=tony ansible_password=Ir0nM@n
172.16.238.11 ansible_user=steve ansible_password=Am3ric@
172.16.238.12 ansible_user=banner ansible_password=BigGr33n

1 Like

Hi @dinesh @Surendar Sorry for this issue. This task is marked Success for you guys.