# get\_url with alternative url

**URL:** <https://forum.ansible.com/t/get-url-with-alternative-url/20575>\
**Category:** Ansible Project\
**Created:** [February 14, 2016, 4:45pm UTC](https://forum.ansible.com/t/get-url-with-alternative-url/20575 "2016-02-14T16:45:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_C1](https://avatars.discourse-cdn.com/v4/letter/m/51bf81/32.png) [@Mike\_C1](https://forum.ansible.com/u/Mike_C1)\
**Post date:** [February 14, 2016, 4:45pm UTC](https://forum.ansible.com/t/get-url-with-alternative-url/20575/1 "2016-02-14T16:45:09Z")

</div>

i got a local cache to store files to download from when im deploying for our production environment thats internal to that network and for that im using get\_url to download stuff.  
But there are times when that local cache is not available and i need to download my stuff from other locations (i.e. the internet).

I could have two steps that

1. try and download from the internal cache
2. if (1) fails, download from the original

but that seems a bit repetitive.

Im not sure if there is another solution for this, but i was thinking maybe i could get get\_url to accept an “alternative\_url” and try that if the primary fails ?

I’d like to hear some input from anyone that is facing similar problems before re-inventing the wheel.

Cheers,  
Mike
