Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add timeout option to get_url #6751

pzhine opened this issue Mar 29, 2014 · 6 comments

Add timeout option to get_url #6751

pzhine opened this issue Mar 29, 2014 · 6 comments
feature net_tools


Copy link

pzhine commented Mar 29, 2014

Issue Type:

“Feature Idea”

Ansible Version:



Ubuntu 12.04


We should be able to specify a timeout for get_url for downloading larger files (or for hitting longer running endpoints).

Right now, it looks like it's fixed at 10 seconds, the default for the timeout param of fetch_url.

Steps To Reproduce:
Expected Results:

TASK: [warmup cache] **********************************************************
changed: []

Actual Results:

TASK: [warmup cache] **********************************************************
fatal: [] => failed to parse: SUDO-SUCCESS-auisjvazbmvdmhizbletefqldvuexvtd
Traceback (most recent call last):
File "/home/ubuntu/.ansible/tmp/ansible-tmp-1396050193.29-76687999901185/get_url", line 1664, in
File "/home/ubuntu/.ansible/tmp/ansible-tmp-1396050193.29-76687999901185/get_url", line 209, in main
tmpsrc, info = url_get(module, url, dest, use_proxy, last_mod_time, force)
File "/home/ubuntu/.ansible/tmp/ansible-tmp-1396050193.29-76687999901185/get_url", line 134, in url_get
rsp, info = fetch_url(module, url, use_proxy=use_proxy, force=force, last_mod_time=last_mod_time)
File "/home/ubuntu/.ansible/tmp/ansible-tmp-1396050193.29-76687999901185/get_url", line 1652, in fetch_url
r = urllib2.urlopen(request, None, timeout)
File "/usr/lib/python2.7/", line 126, in urlopen
return, data, timeout)
File "/usr/lib/python2.7/", line 406, in open
response = meth(req, response)
File "/usr/lib/python2.7/", line 519, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/", line 438, in error
result = self._call_chain(_args)
File "/usr/lib/python2.7/", line 378, in _call_chain
result = func(_args)
File "/usr/lib/python2.7/", line 890, in http_error_401
url, req, headers)
File "/usr/lib/python2.7/", line 865, in http_error_auth_reqed
response = self.retry_http_basic_auth(host, req, realm)
File "/usr/lib/python2.7/", line 878, in retry_http_basic_auth
return, timeout=req.timeout)
File "/usr/lib/python2.7/", line 400, in open
response = self._open(req, data)
File "/usr/lib/python2.7/", line 418, in _open
'_open', req)
File "/usr/lib/python2.7/", line 378, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/", line 1207, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "/usr/lib/python2.7/", line 1180, in do_open
r = h.getresponse(buffering=True)
File "/usr/lib/python2.7/", line 1030, in getresponse
File "/usr/lib/python2.7/", line 407, in begin
version, status, reason = self._read_status()
File "/usr/lib/python2.7/", line 365, in _read_status
line = self.fp.readline()
File "/usr/lib/python2.7/", line 447, in readline
data = self._sock.recv(self._rbufsize)
socket.timeout: timed out

Copy link

mpdehaan commented Mar 29, 2014

Sounds reasonable. Something you would like to work on, perhaps?

Copy link

pzhine commented Mar 29, 2014

Yeah, I'll work on a pull request.

Copy link

geerlingguy commented Apr 28, 2014


Copy link

evgeny-goldin commented Sep 6, 2014


Copy link

mpdehaan commented Sep 29, 2014


Thanks very much for your interest in Ansible. It sincerely means a lot to us.

On September 26, 2014, due to enormous levels of contribution to the project Ansible decided to reorganize module repos, making it easier
for developers to work on the project and for us to more easily manage new contributions and tickets.

We split modules from the main project off into two repos, and

If you would still like this ticket attended to, and believe this problem or idea is still present in the latest version of Ansible (1.7.2) or the development branch, we will need your help in having it reopened in one of the two new repos, and instructions are provided below.

We apologize that we are not able to make this transition happen seamlessly, though this is a one-time change and your help is greatly appreciated --
this will greatly improve velocity going forward.

Both sets of modules will ship with Ansible, though they'll receive slightly different ticket handling.

To locate where a module lives between 'core' and 'extras'

Additionally, should you need more help with this, you can ask questions on:

Thank you very much!

Copy link

geerlingguy commented Sep 29, 2014

Sure thing! Moved over to ansible/ansible-modules-core#20.

@ansibot ansibot added feature and removed feature_idea labels Mar 2, 2018
@dagwieers dagwieers added the net_tools label Mar 3, 2019
@ansible ansible locked and limited conversation to collaborators Apr 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
feature net_tools
None yet

Successfully merging a pull request may close this issue.

6 participants