Hi,
I created YAML Script that should copy folder ,konserwacja" to local. I dont know why, but the folder on Windows in the path ,c:\konserwacja" is empty
I using Windows 11 Pro.
Below is part of the playbook, that should copy folder from network to local.
- name: Copy files from network share to local folder
ansible.windows.win_shell: |
Copy-Item -Path "\\\\10.0.0.14\\wspolne\\konserwacja\\*" -Destination "C:\\konserwacja\\" -Recurse -Force
register: result
args:
executable: powershell
- name: Debug copied files
ansible.builtin.debug:
var: result.stdout_lines
Below is debug:
Bellow is hosts setting:
[pcwindows]
komp2 ansible_host=10.0.0.230
[pcwindows:vars]
ansible_user=Admin
ansible_password=XXXX
ansible_port=5985
ansible_connection=winrm
ansible_winrm_transport=basic
ansible_winrm_server_cert_validation=ignore
The Admin user has permission to use the resource: wspolne (\10.0.0.14\wspolne)