# win\_get\_url and 'force: no' not working?

**URL:** <https://forum.ansible.com/t/win-get-url-and-force-no-not-working/24151>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [April 5, 2017, 8:26pm UTC](https://forum.ansible.com/t/win-get-url-and-force-no-not-working/24151 "2017-04-05T20:26:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cupcake](https://avatars.discourse-cdn.com/v4/letter/c/d6d6ee/32.png) [@cupcake](https://forum.ansible.com/u/cupcake)\
**Post date:** [April 5, 2017, 8:26pm UTC](https://forum.ansible.com/t/win-get-url-and-force-no-not-working/24151/1 "2017-04-05T20:26:24Z")

</div>

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:

`

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [April 5, 2017, 10:10pm UTC](https://forum.ansible.com/t/win-get-url-and-force-no-not-working/24151/2 "2017-04-05T22:10:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![cupcake](https://avatars.discourse-cdn.com/v4/letter/c/d6d6ee/32.png) [@cupcake](https://forum.ansible.com/u/cupcake)\
**Post date:** [April 5, 2017, 10:42pm UTC](https://forum.ansible.com/t/win-get-url-and-force-no-not-working/24151/3 "2017-04-05T22:42:42Z")

</div>

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 [foo.com](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](http://ASP.NET)

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [April 6, 2017, 7:12am UTC](https://forum.ansible.com/t/win-get-url-and-force-no-not-working/24151/4 "2017-04-06T07:12:16Z")

</div>

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)?

---

<div class="post-metadata">

**Author:** ![cupcake](https://avatars.discourse-cdn.com/v4/letter/c/d6d6ee/32.png) [@cupcake](https://forum.ansible.com/u/cupcake)\
**Post date:** [April 6, 2017, 10:42am UTC](https://forum.ansible.com/t/win-get-url-and-force-no-not-working/24151/5 "2017-04-06T10:42:36Z")

</div>

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.
