win_copy error doesnt state what is the issue

42 views
Skip to first unread message

Eric Tan

unread,
Apr 23, 2019, 4:01:18 AM4/23/19
to Ansible Project
Hi all,

I have followed the instructions on Ansible docs on how to do a windows copy from local linux to remote windows.

However i encounter error with no head nor tail what the issue is. I can confirm the script is able to find the app.zip file as when i changed the name to app2.zip, the ansible error thrown is unable to locate app2.zip file.

Error:
-----
fatal: [localhost]: FAILED! => {"changed": false, "checksum": "8baeccfaacc8ce4feacf9d163336e4bcb5b0bda8", "dest": "C:\\inetpub\\wwwroot\\", "module_stderr": "", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "operation": "file_copy", "original_basename": "app.zip", "rc": 0, "size": 11725372, "src": "app.zip"}



My playbook as below:
-----
- name: Deploy to test instances
  hosts: localhost
  vars_files:
  - "group_vars/test"
  - group_vars/all

  tasks:
  - name: Wait for WinRM to answer on all hosts
    wait_for:
       port: 5986
       host: "xx.xx.xx.xx"
       timeout: 300

  - name: copy app zip file to app server
    win_copy:
        src: app    register: copyfiletime
        dest: C:\inetpub\wwwroot\
    register: copyfiletime

  - debug: msg={{ copyfiletime.stdout }}

  - debug: msg={{ copyfiletime.stderr }}




Can anyone here advise if i have missed out any step or configuration?

Soniya panwar

unread,
Apr 26, 2019, 4:14:13 AM4/26/19
to Ansible Project
Hello Eric Tan,

Could you please run your playbook with -vvvv to see if there is any more exception information available and paste results here?

Thanks
Soniya
Reply all
Reply to author
Forward
0 new messages