{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/1091","labels_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/1091/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/1091/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/1091/events","html_url":"https://github.com/ansible/ansible-modules-core/pull/1091","id":66488591,"number":1091,"title":"Add custom headers to get_url module","user":{"login":"ktriponis","id":1522437,"avatar_url":"https://avatars.githubusercontent.com/u/1522437?v=3","gravatar_id":"","url":"https://api.github.com/users/ktriponis","html_url":"https://github.com/ktriponis","followers_url":"https://api.github.com/users/ktriponis/followers","following_url":"https://api.github.com/users/ktriponis/following{/other_user}","gists_url":"https://api.github.com/users/ktriponis/gists{/gist_id}","starred_url":"https://api.github.com/users/ktriponis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktriponis/subscriptions","organizations_url":"https://api.github.com/users/ktriponis/orgs","repos_url":"https://api.github.com/users/ktriponis/repos","events_url":"https://api.github.com/users/ktriponis/events{/privacy}","received_events_url":"https://api.github.com/users/ktriponis/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/feature_pull_request","name":"feature_pull_request","color":"009800"},{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/P3","name":"P3","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-05T22:15:53Z","updated_at":"2015-06-18T14:03:25Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/pulls/1091","html_url":"https://github.com/ansible/ansible-modules-core/pull/1091","diff_url":"https://github.com/ansible/ansible-modules-core/pull/1091.diff","patch_url":"https://github.com/ansible/ansible-modules-core/pull/1091.patch"},"body":"This is just a simple patch to expose headers for get_url module. This option is especially useful in cases like downloading oracle java where one has to accept a license before being able to download which is easily achievable by passing a cookie in a request.\r\n\r\nWhile now such downloads could be achieved using command module like so:\r\n\r\n    - command: curl --location --header \"Cookie:oraclelicense=accept-securebackup-cookie\" --output /opt/java.tar.gz http://download.oracle.com/otn-pub/java/jdk/8u40-b25/server-jre-8u40-linux-x64.tar.gz\r\n      args:\r\n        creates: /opt/java.tar.gz\r\n\r\nBut this approach implies that you have curl installed on your system which is not always true and so to make the playbook work with most systems you either have to install curl or write a special case for systems with curl and wget separately.\r\n\r\nThis patch would allow to do this simply using get_url like so:\r\n\r\n    - get_url:\r\n        url: http://download.oracle.com/otn-pub/java/jdk/8u40-b25/server-jre-8u40-linux-x64.tar.gz\r\n        dest: /opt/java.tar.gz\r\n        headers:\r\n          Cookie: \"oraclelicense=accept-securebackup-cookie\""},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/comments/113166831","html_url":"https://github.com/ansible/ansible-modules-core/pull/1091#issuecomment-113166831","issue_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/1091","id":113166831,"user":{"login":"ktriponis","id":1522437,"avatar_url":"https://avatars.githubusercontent.com/u/1522437?v=3","gravatar_id":"","url":"https://api.github.com/users/ktriponis","html_url":"https://github.com/ktriponis","followers_url":"https://api.github.com/users/ktriponis/followers","following_url":"https://api.github.com/users/ktriponis/following{/other_user}","gists_url":"https://api.github.com/users/ktriponis/gists{/gist_id}","starred_url":"https://api.github.com/users/ktriponis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktriponis/subscriptions","organizations_url":"https://api.github.com/users/ktriponis/orgs","repos_url":"https://api.github.com/users/ktriponis/repos","events_url":"https://api.github.com/users/ktriponis/events{/privacy}","received_events_url":"https://api.github.com/users/ktriponis/received_events","type":"User","site_admin":false},"created_at":"2015-06-18T14:03:25Z","updated_at":"2015-06-18T14:03:25Z","body":"@bennojoy of course, just not entirely sure what version I should put there. Should it be 1.9.something or 2.something?"}}