I am trying to copy a zip file on windows machine.For this I am using win_copy module.The issue is that for some windows server it works fine but for some it is failing to copy zip files.
This is the ansible tasks:-
- name: Copy telegraf zip
win_copy:
src: /git/telegraf/{{ telegraf_zip_name }}
dest: c:\temp\
vars:
ansible_user: NTNET\win_user # Replace with your domain and username
ansible_password: "" # Replace with your password
ansible_connection: winrm
ansible_winrm_transport: ntlm
ansible_winrm_server_cert_validation: ignore
tags: packages
Yes, Ansible uses PowerShell to manage Windows-based target host.
Since you seem to be using Ansible 2.9, so first of all please refer to Ansible 2.9 User Guide:
Ansible requires PowerShell 3.0 or newer and at least .NET 4.0 to be installed on the Windows host.
Maybe upgrading PowerShell and .NET Framework are required.
The user guide above also provides basic steps to make your Windows host meet requirements, so please give it a try.
@husnain_taja this appears to be an ansible issue rather than an awx issue. Would you mind adjusting the labels accordingly? That will help ensure the correct team sees this.
@husnain_taja this appears to be an ansible issue rather than an awx issue. Would you mind adjusting the labels accordingly? That will help ensure the correct team sees this.
It’s ultimately a neither issue, OP is targeting a host that has PowerShell 2.0 which has never been supported by Ansible. The latest version of Ansible only supports PowerShell 5.1 while some older do work with 3.0, and 4.0. They’ll need to update their host to ensure they are running with a compatible PowerShell version.