|
|
|
@ -107,15 +107,16 @@ options:
|
|
|
|
|
default: no
|
|
|
|
|
follow_redirects:
|
|
|
|
|
description:
|
|
|
|
|
- Whether or not the URI module should follow redirects. V(all) will follow all redirects.
|
|
|
|
|
V(safe) will follow only "safe" redirects, where "safe" means that the client is only
|
|
|
|
|
doing a GET or HEAD on the URI to which it is being redirected. V(none) will not follow
|
|
|
|
|
any redirects. Note that V(true) and V(false) choices are accepted for backwards compatibility,
|
|
|
|
|
where V(true) is the equivalent of V(all) and V(false) is the equivalent of V(safe). V(true) and V(false)
|
|
|
|
|
are deprecated and will be removed in some future version of Ansible.
|
|
|
|
|
- Whether or not the URI module should follow redirects.
|
|
|
|
|
type: str
|
|
|
|
|
choices: ['all', 'no', 'none', 'safe', 'urllib2', 'yes']
|
|
|
|
|
default: safe
|
|
|
|
|
choices:
|
|
|
|
|
all: Will follow all redirects.
|
|
|
|
|
none: Will not follow any redirects.
|
|
|
|
|
safe: Only redirects doing GET or HEAD requests will be followed.
|
|
|
|
|
urllib2: Defer to urllib2 behavior (As of writing this follows HTTP redirects).
|
|
|
|
|
'no': (DEPRECATED, removed in 2.22) alias of V(none).
|
|
|
|
|
'yes': (DEPRECATED, removed in 2.22) alias of V(all).
|
|
|
|
|
creates:
|
|
|
|
|
description:
|
|
|
|
|
- A filename, when it already exists, this step will not be run.
|
|
|
|
@ -580,6 +581,12 @@ def uri(module, url, dest, body, body_format, method, headers, socket_timeout, c
|
|
|
|
|
# if destination file already exist, only download if file newer
|
|
|
|
|
kwargs['last_mod_time'] = utcfromtimestamp(os.path.getmtime(dest))
|
|
|
|
|
|
|
|
|
|
if module.params.get('follow_redirects') in ('no', 'yes'):
|
|
|
|
|
module.deprecate(
|
|
|
|
|
"Using 'yes' or 'no' for 'follow_redirects' parameter is deprecated.",
|
|
|
|
|
version='2.22'
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
resp, info = fetch_url(module, url, data=data, headers=headers,
|
|
|
|
|
method=method, timeout=socket_timeout, unix_socket=module.params['unix_socket'],
|
|
|
|
|
ca_path=ca_path, unredirected_headers=unredirected_headers,
|
|
|
|
|