Hi,
I am trying some windows modules.
My test environment below :
- Control machine : CentOS 6.6 x86_64 , Ansible version : v2.0.0
- Remote machine : Windows Server 2012 R2 Standard
I found the win_unzip module document then I tried the following.
# Install PSCX to use for extracting a gz file
- name: Grab PSCX msi
win_get_url:
url: 'http://download-codeplex.sec.s-msft.com/Download/Release?ProjectName=pscx&DownloadId=923562&FileTime=130585918034470000&Build=20959’
dest: 'C:\pscx.msi'
- name: Install PSCX
win_msi:
path: 'C:\pscx.msi'
- name: Unzip gz log
win_unzip:
src: "C:\Logs\application-error-logs.gz"
dest: "C:\ExtractedLogs\application-error-logs"
However , I saw that the win_get_url failed to get PSCX.msi.
TASK [Grab PSCX msi] ***********************************************************
<10.1.1.6> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT
5986 TO 10.1.1.6
<10.1.1.6> EXEC (New-Item -Type Directory -Path $env:temp -Name
"ansible-tmp-1440635296.7-251435026679972").FullName | Write-Host
-Separator '';
<10.1.1.6> PUT "/tmp/tmpRR0wmP" TO
"C:\Users\Administrator\AppData\Local\Temp\ansible-tmp-1440635296.7-251435026679972\win_get_url"
<10.1.1.6> EXEC Try { &
"C:\Users\Administrator\AppData\Local\Temp\ansible-tmp-1440635296.7-251435026679972\win_get_url.ps1"
}
Catch { throw }
Finally { Remove-Item
"C:\Users\Administrator\AppData\Local\Temp\ansible-tmp-1440635296.7-251435026679972"
-Force -Recurse -ErrorAction SilentlyContinue }
fatal: [10.1.1.6]: FAILED! => {"changed": false, "failed": true,
"msg": "Error downloading
http://download-codeplex.sec.s-msft.com/Download/Release?ProjectName=pscx&DownloadId=923562&FileTime=130585918034470000&Build=20959
to C:\\Users\\Administrator\\Desktop\\pscx.msi"}
I could get other file from another web site by win_get_url. Also when
I use a browser to get this file on remote machine, it was success.
Could you give me some advice?
Regards,
Takeshi.K