Reputation: 11098
I have provisioned a server with ansibl
e and now I would like to clone a private git repo
(not github
).
So my local machine's ssh key
is authorized on the private git repo
and what I have done up till now is copy
my local public and private ssh key to the server.
But I feel this is not the best way to go about it.
I know if you are using github
you can use the API
to create a deploy key. But I am not.
So the only other way I can see is:
fetch
ssh-copy-id
or use authorized_keys
to add the servers key to the private git repoIs there something I am missing, can it be done in another easier way?
Upvotes: 0
Views: 111
Reputation: 854
You haven't described what your constraints are, and haven't mentioned if you're comfortable creating additional keys and managing them within your private git repo.
Another possible option:
ssh-agent
and add your personal key to it before running ansible, and forward your agent to the remote host when you run ansible.For that solution: SSH Agent Forwarding with Ansible for more details.
Upvotes: 1