get_url support custom headers

286 views
Skip to first unread message

Andrew Craft

unread,
Nov 3, 2014, 3:37:02 AM11/3/14
to ansible...@googlegroups.com

From what i can see get_url doesn't support specifying custom http headers like the uri module.

What i am trying to do is download some files from the object storage in Softlayer (based on SwiftStack)

1) Customised the softlayer inventory file to include username and apikey as group_vars when generating inventory
2) use uri module to authenticate against object storage and get storage auth token
3) use get_url to download files but need to specify custom header to include token

Am I am correct in saying can't specify custom header in get_url, happy to try and create a patch to support this if this is ok?

thanks
Andrew

Michael DeHaan

unread,
Nov 3, 2014, 9:39:09 AM11/3/14
to ansible...@googlegroups.com
It seems to be me (longer-term) we'd benefit from having some modules explicitly for SoftLayer instead as opposed to going through the uri module.

get_url is basically there for easy downloads of web resources.

I think we are open to the idea of having it take a new parameter (try to match up with what uri does, I'd think).



--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/d4ae9c6f-350b-4c54-9781-4f0a7265d2ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andrew Craft

unread,
Nov 3, 2014, 10:02:37 AM11/3/14
to ansible...@googlegroups.com
Agree would be nice for some kind of softlayer support but requires a bit more thought and structure for username/keys/authentication end points etc so figured this would be simpler in short term for my needs and still potentially useful for others

Will take a look and see i can put a patch together.

--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/2qKidJ1Kw1I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.

To post to this group, send email to ansible...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages