ansible 2.8.0
Running uri module as
uri:
dest: .
url: https://{{ hostvars[inventory_hostname].ansible_host }}:{{
apache.port }}/context-root/some-context
validate_certs: false
return_content: true
follow_redirects: none
status_code:
- 302
register: page
changed_when: false
delegate_to: localhost
This results in a 302 with the Location header set to a "relative" url.
Ansible follows the 302, ignoring the follow_redirects setting, and fails
on the relative URL with the message
"msg": "unknown url type: /cas/login?service=something"
The full traceback is:
WARNING: The below traceback may *not* be related to the actual failure.
File
"/tmp/ansible_uri_payload__lMgyr/ansible_uri_payload.zip/ansible/module_utils/urls.py",
line 1353, in fetch_url
unix_socket=unix_socket)
File
"/tmp/ansible_uri_payload__lMgyr/ansible_uri_payload.zip/ansible/module_utils/urls.py",
line 1251, in open_url
use_gssapi=use_gssapi, unix_socket=unix_socket)
File
"/tmp/ansible_uri_payload__lMgyr/ansible_uri_payload.zip/ansible/module_utils/urls.py",
line 1157, in open
r = urllib_request.urlopen(*urlopen_args)
File "/usr/lib64/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib64/python2.7/urllib2.py", line 423, in open
protocol = req.get_type()
File "/usr/lib64/python2.7/urllib2.py", line 285, in get_type
raise ValueError, "unknown url type: %s" % self.__original
1. Why is Ansible ignoring the follow_redirects setting
2. Can Ansible follow relative URLs on 302?
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/10ec1717-6606-4dec-a19f-8cbdf5a68174%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.