win_get_url and 'force: no' not working?

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:

`

Looks like there’s only a few seconds there between the modification and the request (last example anyway).
Just wondering if the clocks are in sync between the ansible controller and the windows box - they will need to agree on UTC for this to work.
Also worth checking the timezones on both systems.
Hope this helps,
Jon

the second curl is the difference of the file from the earlier one, so it should have picked up but i see what you are saying if the other system is 30 sec off or so it might now.

I’ve just re-run it again and it still fails so it def should have picked up by now. all three systems are EST and syncing to ntp; i can also auth with kerberos.

interestingly, if i change the url argument to say a new txt file instead such as test.txt but keep the dest file the same on target, it still does not copy the file over.

`

date

Wed Apr 5 18:29:13 EDT 2017

curl -I http://windc1.foo.com/shares/test.txt

HTTP/1.1 200 OK
Content-Length: 5
Content-Type: text/plain
Last-Modified: Wed, 05 Apr 2017 22:27:16 GMT
Accept-Ranges: bytes
ETag: “bb360c85baed21:0”
Server: Microsoft-IIS/7.5
X-Powered-By: ASP.NET

I’m fairly certain it checks to see if the destination file exists before it attempts to retrieve last modified time - if the destination file doesn’t exist then it should attempt the download anyway.

A bug fix was merged recently where the last-modified check wouldn’t respect proxy settings if you were using a proxy - but that doesn’t look like it applies to you.

I mostly tested this with nginx but would be surprised if IIS is anything but well-behaved when it comes to correctly setting last-modified.

Is there some network cleverness going on like squid or similar that might be confusing matter (although why it would not affect curl I can’t imagine)?

No network cleverness here ATM, these are just test machines right now on a single subnet. Vanilla rhel7.3 install and vanilla win install. Happy to set up another test scenario if it helps.