ansible-collections / ansible.windows

Windows core collection for Ansible
https://galaxy.ansible.com/ansible/windows
GNU General Public License v3.0
233 stars 157 forks source link

win_copy doesnt work when folder name has special character #609

Open periyasamy003 opened 1 month ago

periyasamy003 commented 1 month ago
SUMMARY

Tasks are failing when the folder name has special characters.

ISSUE TYPE
COMPONENT NAME

win_copy

ANSIBLE VERSION
ansible-2.9.9
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT

Client--> Linux (Jenkins worker node) Target --> Windows server

STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS
TASK [Copy files from workspace with special characters] **************************
fatal: [win_server]: FAILED! => {"changed": true, "dest": "C:\\tmp", "module_stderr": "An error occurred while creating the pipeline.\r\n    + CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordException\r\n    + FullyQualifiedErrorId : RuntimeException\r\n \r\nException 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: An item with the spec\r\nified name C:\\tmp\\[...slug] already exists.\"\"\r\nAt line:93 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", "operation": "folder_copy", "rc": 1, "src": "/opt/jenkins/workspace/"}
jborean93 commented 1 month ago

Can you try a newer version of Ansible and subsequently a newer version of this collection. 2.9 is quite old and the win_copy for that code predated this collection. I also believe I fixed this issue at some point but I’m not 100% sure on that.

hiyokotaisa commented 1 month ago

I tested same scenario with ansible-core 2.15.10 but it is working as expected. I'm assuming this is fixed on current ansible version