ansible 2.2.1.0
windows server 2008 r2 x64
Trying to use win_get_url for an xml file update. I can curl the file and
see that it notices newer timestamp but force: no does not pull the new
file down.
pbook:
---
# tasks file for packages
- name:
hosts: windows
tasks:
- name: Get XML file if newer
win_get_url:
url: 'http://windc1.foo.com/shares/testfile.xml'
dest: 'C:\temp\testfile.xml'
force: no
curl original:
# curl -I http://windc1.foo.com/shares/testfile.xml
HTTP/1.1 200 OK
Content-Length: 123
Content-Type: text/xml
Last-Modified: Wed, 05 Apr 2017 13:27:23 GMT
Accept-Ranges: bytes
ETag: "d9df35b10aed21:0"
Server: Microsoft-IIS/7.5
X-Powered-By: ASP.NET
Date: Wed, 05 Apr 2017 20:16:03 GMT
fresh run w no file pre-existing:
changed: [winserver1.foo.com] => {
"changed": true,
"invocation": {
"module_name": "win_get_url"
},
"win_get_url": {
"dest": "C:\\temp\\testfile.xml",
"url": "http://windc1.foo.com/shares/testfile.xml"
}
}
run again w no changes to origin:
ok: [winserver1.foo.com] => {
"changed": false,
"invocation": {
"module_name": "win_get_url"
},
"win_get_url": {
"dest": "C:\\temp\\testfile.xml",
"url": "http://windc1.foo.com/shares/testfile.xml"
}
}
add line to xml and curl again:
# curl -I http://windc1.foo.com/shares/testfile.xml
HTTP/1.1 200 OK
Content-Length: 150
Content-Type: text/xml
Last-Modified: Wed, 05 Apr 2017 20:17:46 GMT
Accept-Ranges: bytes
ETag: W/"b7d256b049aed21:0"
Server: Microsoft-IIS/7.5
X-Powered-By: ASP.NET
Date: Wed, 05 Apr 2017 20:17:48 GMT
ok: [winserver1.foo.com] => {
"changed": false,
"invocation": {
"module_name": "win_get_url"
},
"win_get_url": {
"dest": "C:\\temp\\testfile.xml",
"url": "http://windc1.foo.com/shares/testfile.xml"
}
}
I saw some bugs regarding force: no not working properly on older versions
of ansible, but perhaps this issue still exists on 2.2.x.
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/af2f6c39-c7ca-4428-beab-efac9b3ec5f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.