Closed ichundu closed 7 years ago
@ansible ping, this issue is waiting for your response. click here for bot help
This repository has been locked. All new issues and pull requests should be filed in https://github.com/ansible/ansible
Please read through the repomerge page in the dev guide. The guide contains links to tools which automatically move your issue or pull request to the ansible/ansible repo.
I believe this feature will not be implemented in authorized keys, since as you mention it breaks the convention of running a module with all arguments on the target host.
There is a straight-forward workaround, which makes the transfer of data more explicit (rough scetch, needs to be extended to work):
- name: pull keys from server
uri:
url: https://gitlab_server/username.keys
return_content: True
register: keys
delegate_to: localhost
- name: set authorized_keys
authorized_key:
...
key: keys.content
With this I'd consider the problem solved. close_me
Feel free to reopen if needed.
ISSUE TYPE
COMPONENT NAME
module: authorized_key
ANSIBLE VERSION
CONFIGURATION
None which affect module behaviour.
OS / ENVIRONMENT
N/A
SUMMARY
In 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 to the target machine first 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 from URL very useful and it seems useless if target servers cannot access the git server to get the keys.
STEPS TO REPRODUCE
Try to deploy the keys to a target that cannot access the git server.
EXPECTED RESULTS
ACTUAL RESULTS
Because the target server cannot access the local git server the following error appears.