Skip to content

Commit

Permalink
[stable-2.16] uri: update docs for follow_redirects (#83177)
Browse files Browse the repository at this point in the history
* [stable-2.16] uri: update docs for follow_redirects

* Updated the docs for the parameter follow_redirects

Signed-off-by: Abhijeet Kasurde <[email protected]>
(cherry picked from commit fcc6d0b)

* CI fixes

Signed-off-by: Abhijeet Kasurde <[email protected]>

---------

Signed-off-by: Abhijeet Kasurde <[email protected]>
  • Loading branch information
Akasurde committed May 9, 2024
1 parent 3761e11 commit b92e2eb
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/uri_follow_redirect_bool.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
bugfixes:
- uri - update the documentation for follow_redirects.
15 changes: 8 additions & 7 deletions lib/ansible/modules/uri.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,15 @@
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.
- V(all) Will follow all redirects.
- V(none) Will not follow any redirects.
- V(safe) Only redirects doing GET or HEAD requests will be followed.
- V(urllib2) Defer to urllib2 behavior (As of writing this follows HTTP redirects).
- V('no') (DEPRECATED, will be removed in the future version) alias of V(none).
- V('yes') (DEPRECATED, will be removed in the future version) alias of V(all).
choices: ['all', 'none', 'safe', 'urllib2', 'yes', 'no']
type: str
choices: ['all', 'no', 'none', 'safe', 'urllib2', 'yes']
default: safe
creates:
description:
Expand Down
10 changes: 9 additions & 1 deletion lib/ansible/plugins/lookup/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,14 @@
- section: url_lookup
key: force_basic_auth
follow_redirects:
description: String of urllib2, all/yes, safe, none to determine how redirects are followed, see RedirectHandlerFactory for more information
description:
- String of urllib2, all/yes, safe, none to determine how redirects are followed, see RedirectHandlerFactory for more information.
- V(all) Will follow all redirects.
- V(none) Will not follow any redirects.
- V(safe) Only redirects doing GET or HEAD requests will be followed.
- V(urllib2) Defer to urllib2 behavior (As of writing this follows HTTP redirects).
- V('no') (DEPRECATED, will be removed in the future version) alias of V(none).
- V('yes') (DEPRECATED, will be removed in the future version) alias of V(all).
type: string
version_added: "2.10"
default: 'urllib2'
Expand All @@ -99,6 +106,7 @@
ini:
- section: url_lookup
key: follow_redirects
choices: ['all', 'none', 'safe', 'urllib2', 'yes', 'no']
use_gssapi:
description:
- Use GSSAPI handler of requests
Expand Down

0 comments on commit b92e2eb

Please sign in to comment.