Hello,
I’m trying to copy files betwen two win servers with ntlm authentication. This is my ansible hosts conf:
`
Windows servers configuration
`
[win]
server1.domain.com
[win:vars]
ansible_user=serveradmin@domain.com
ansible_password=serveradminpassword
ansible_connection=winrm
ansible_winrm_transport=ntlm
ansible_port=5985
ansible_winrm_server_cert_validation=ignore
This is my script:
`
- name: Copy files in windows systems
`
hosts: win
tasks:
gather_facts: false
tasks:
- win_copy:
src: ‘\server1.domain.com\c$\temp\test-transfer-ansible.txt’
dest: ‘\server2.domain.com\c$\temp’
remote_src: True
That’s the output when I try to run a script:
`
[root@Ansible win]# ansible-playbook win_remote-copy.yml -f 10
[WARNING]: While constructing a mapping from /var/lib/awx/projects/win/win_remote-copy.yml, line 2, column 3, found a duplicate dict key (tasks). Using last defined value only.
PLAY [Copy files in windows systems] **************************************************************************************************************************************************
TASK [win_copy] ***********************************************************************************************************************************************************************
/usr/lib/python2.7/site-packages/requests_ntlm/requests_ntlm.py:200: NoCertificateRetrievedWarning: Requests is running with a non urllib3 backend, cannot retrieve server certificate for CBT
NoCertificateRetrievedWarning)
/usr/lib/python2.7/site-packages/requests_ntlm/requests_ntlm.py:200: NoCertificateRetrievedWarning: Requests is running with a non urllib3 backend, cannot retrieve server certificate for CBT
NoCertificateRetrievedWarning)
fatal: [server1.domain.com]: FAILED! => {“changed”: false, “dest”: “\\server1.domian.com\c$\temp”, “module_stderr”: “Exception calling "Run" with "1" argument(s): "Exception calling "Invoke" with "0" argument(s): "The running command st\r\nopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Access is denied""\r\nAt line:65 char:5\r\n+ $output = $entrypoint.Run($payload)\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n + CategoryInfo : NotSpecified: ( , ParentContainsErrorRecordException\r\n + FullyQualifiedErrorId : ScriptMethodRuntimeException\r\n \r\n”, “module_stdout”: “”, “msg”: “MODULE FAILURE”, “rc”: 1, “src”: “\\server1.domain.com\c$\temp\test-transfer-ansible.txt”}
fatal: [server2.domain.com]: FAILED! => {“changed”: false, “dest”: “\\server2.domain.com\c$\temp”, “module_stderr”: “Exception calling "Run" with "1" argument(s): "Exception calling "Invoke" with "0" argument(s): "The running command \r\nstopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Access is denied""\r\nAt line:65 char:5\r\n+ $output = $entrypoint.Run($payload)\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n + CategoryInfo : NotSpecified: ( , ParentContainsErrorRecordException\r\n + FullyQualifiedErrorId : ScriptMethodRuntimeException\r\n \r\n”, “module_stdout”: “”, “msg”: “MODULE FAILURE”, “rc”: 1, “src”: “\\server1.domain.com\c$\temp\test-transfer-ansible.txt”}
to retry, use: --limit @/var/lib/awx/projects/win/win_remote-copy.retry
PLAY RECAP ****************************************************************************************************************************************************************************
server1.doman.com : ok=0 changed=0 unreachable=0 failed=1
server2.domain.com : ok=0 changed=0 unreachable=0 failed=1
[root@Ansible win]#
`
Any clue what is wrong with the scrpt…? User is server admin,
Thanks for any help.