{"action":"opened","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/5835","repository_url":"https://api.github.com/repos/ansible/ansible-modules-core","labels_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/5835/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/5835/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/5835/events","html_url":"https://github.com/ansible/ansible-modules-core/issues/5835","id":193576160,"number":5835,"title":"authorized_key cannot pull keys from local git server","user":{"login":"ichundu","id":16067816,"avatar_url":"https://avatars.githubusercontent.com/u/16067816?v=3","gravatar_id":"","url":"https://api.github.com/users/ichundu","html_url":"https://github.com/ichundu","followers_url":"https://api.github.com/users/ichundu/followers","following_url":"https://api.github.com/users/ichundu/following{/other_user}","gists_url":"https://api.github.com/users/ichundu/gists{/gist_id}","starred_url":"https://api.github.com/users/ichundu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ichundu/subscriptions","organizations_url":"https://api.github.com/users/ichundu/orgs","repos_url":"https://api.github.com/users/ichundu/repos","events_url":"https://api.github.com/users/ichundu/events{/privacy}","received_events_url":"https://api.github.com/users/ichundu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-05T18:36:39Z","updated_at":"2016-12-05T18:36:39Z","closed_at":null,"body":"<!--- Verify first that your issue/request is not already reported in GitHub -->\r\n\r\n##### ISSUE TYPE\r\n<!--- Pick one below and delete the rest: -->\r\n - Feature Idea\r\n\r\n##### COMPONENT NAME\r\n<!--- Name of the plugin/module/task -->\r\nmodule: authorized_key\r\n\r\n##### ANSIBLE VERSION\r\n<!--- Paste verbatim output from “ansible --version” between quotes below -->\r\n```\r\nansible 2.2.0.0\r\n  config file = /home/username/.ansible.cfg\r\n  configured module search path = Default w/o overrides\r\n```\r\n\r\n##### CONFIGURATION\r\n<!---\r\nMention any settings you have changed/added/removed in ansible.cfg\r\n(or using the ANSIBLE_* environment variables).\r\n-->\r\nNone which affect module behaviour.\r\n\r\n##### OS / ENVIRONMENT\r\n<!---\r\nMention the OS you are running Ansible from, and the OS you are\r\nmanaging, or say “N/A” for anything that is not platform-specific.\r\n-->\r\nN/A\r\n\r\n##### SUMMARY\r\n<!--- Explain the problem briefly -->\r\nIn my company we are using a local git repository server (gitlab) and very few servers are able to access it. The majority of servers don't have network access to our local gitlab instance since we use it exclusively for ansible. So when i use the authorized_key module to deploy ssh keys and tell it to pull the keys from our gitlab instance (https://gitlab_server/{{ username }}.keys) the servers that can't access our gitlab instance cannot pull the keys. I understand that the module is copied at the target machine and then executed, but it would be neat if there could be a way to get the keys from the git server before the module is copied to the target machine. sorry if this is to much to ask and i know there are other ways to deploy ssh keys, but i find the ability to provide the keys with a URL very useful and it seems useless if target servers cannot access the git server to get the keys.\r\n\r\n##### STEPS TO REPRODUCE\r\n<!---\r\nFor bugs, show exactly how to reproduce the problem.\r\nFor new features, show how the feature would be used.\r\n-->\r\nTry to deploy the keys to a target that cannot access the git server.\r\n\r\n<!--- Paste example playbooks or commands between quotes below -->\r\n```\r\n- name: \"Deploy public ssh key for username\"\r\n  authorized_key:\r\n    user: \"username\"\r\n    key: \"https://gitlab_server/username.keys\"\r\n    exclusive: yes\r\n    validate_certs: no\r\n    state: present\r\n```\r\n\r\n<!--- You can also paste gist.github.com links for larger files -->\r\n\r\n##### EXPECTED RESULTS\r\n<!--- What did you expect to happen when running the steps above? -->\r\n```\r\nchanged: [ansible_host]\r\n```\r\n\r\n##### ACTUAL RESULTS\r\n<!--- What actually happened? If possible run with extra verbosity (-vvvv) -->\r\nBecause the target server cannot access the local git server the following error appears.\r\n```\r\nfatal: [ansible_host]: FAILED! => {\r\n    \"changed\": false, \r\n    \"failed\": true, \r\n    \"invocation\": {\r\n        \"module_args\": {\r\n            \"exclusive\": true, \r\n            \"key\": \"https://gitlab_server/username.keys\", \r\n            \"key_options\": null, \r\n            \"manage_dir\": true, \r\n            \"path\": null, \r\n            \"state\": \"present\", \r\n            \"unique\": false, \r\n            \"user\": \"username\", \r\n            \"validate_certs\": false\r\n        }, \r\n        \"module_name\": \"authorized_key\"\r\n    }, \r\n    \"msg\": \"Error getting key from: https://gitlab_server/username.keys\"\r\n}\r\n```\r\n"}}
{"actor":{"display_login":"ichundu"}}