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

get_url fails to download https url on Ubuntu 16.04 #50436

Closed
zaixi opened this issue Jan 2, 2019 · 4 comments
Closed

get_url fails to download https url on Ubuntu 16.04 #50436

zaixi opened this issue Jan 2, 2019 · 4 comments
Labels
affects_2.7 This issue/PR affects Ansible v2.7 bug This issue/PR relates to a bug. module This issue/PR relates to a module. net_tools Net-tools category support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@zaixi
Copy link

zaixi commented Jan 2, 2019

SUMMARY
ISSUE TYPE
  • Bug Report
COMPONENT NAME

get_url module

ANSIBLE VERSION
ansible 2.7.5
  config file = /home/liyj/github/ansible-ubuntu/ansible.cfg
  configured module search path = [u'/home/liyj/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.12 (default, Nov 12 2018, 14:36:49) [GCC 5.4.0 20160609]
CONFIGURATION

OS / ENVIRONMENT

Ubuntu 16.04

STEPS TO REPRODUCE
- name: get public_key                                                                       
  get_url:
    url: https://build.opensuse.org/projects/home:manuelschneid3r/public_key
    dest: /tmp/albert_gpg
EXPECTED RESULTS

The file should be downloaded

ACTUAL RESULTS
fatal: [localhost]: FAILED! => changed=false 
  dest: /tmp/albert_gpg
  msg: Request failed
  response: 'HTTP Error 404: Not Found'
  state: absent
  status_code: 404
  url: https://build.opensuse.org/projects/home:manuelschneid3r/public_key
@ansibot
Copy link
Contributor

ansibot commented Jan 2, 2019

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Jan 2, 2019

@ansibot ansibot added affects_2.7 This issue/PR affects Ansible v2.7 bug This issue/PR relates to a bug. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. net_tools Net-tools category support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Jan 2, 2019
@sivel
Copy link
Member

sivel commented Jan 3, 2019

The problem here appears to be with the URL you are requesting. It seems to require that an Accept header be passed along with it.

rfc2616 states:

If no Accept header field is present, then it is assumed that the client accepts all media types.

So the server handling the request is not RFC2616 compliant.

However, to work around the issue, you can simply add:

- name: get public_key                                                                       
  get_url:
    url: https://build.opensuse.org/projects/home:manuelschneid3r/public_key
    dest: /tmp/albert_gpg
    headers:
      Accept: '*/*'

If you have further questions please stop by IRC or the mailing list:

@sivel sivel closed this as completed Jan 3, 2019
@sivel sivel removed the needs_triage Needs a first human triage before being processed. label Jan 3, 2019
@zaixi
Copy link
Author

zaixi commented Jan 4, 2019

Thank you, he is working now.

@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.7 This issue/PR affects Ansible v2.7 bug This issue/PR relates to a bug. module This issue/PR relates to a module. net_tools Net-tools category support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

No branches or pull requests

3 participants