How do I use remote machine's SSH keys in ansible git module

前端 未结 2 1322
抹茶落季
抹茶落季 2021-02-05 09:15

I\'ve been trying to get Ansible to provision a remote machine, and I want the remote machine to be set up with its own keys, and have the ability to clone git repositories from

2条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-05 10:15

    If I understand this correctly, you do - or want to - deploy your private key to the remote machine so you can clone the repo. I believe instead you should use key forwarding. In your .ssh/config set this:

    ForwardAgent yes
    

    Or if you want to limit this to Ansible you can define it in your ansible.cfg:

    [ssh_connection]
    ssh_args= -A
    

提交回复
热议问题