Two ssh-agents: one for Ansible, one for git 0 ▲ Dan Langille's Other Diary 1 hour ago · 5 min read1061 words · Tech · hide My usual ssh-agent holds a lot of keys. That is fine when I ssh to one host at a time. It is not fine when Ansible connects to about 90 hosts at once. Every connection offered key after key. Some of those keys need confirmation before use, so I was clicking prompts. Some hosts gave up with Too many authentication failures. Some runs timed out. It was slow. Yes, I should be running fewer keys here: [15:24 dvl@pro05:~] % ssh-add -L | wc -l 7 That is a topic for another post. The old workaround Ansible runs as root in a jail I call ansible. My workaround was to log in without agent forwarding, then start a fresh agent in the jail holding only the Ansible key: ssh -a ansible eval $(ssh-agent -s) ssh-add That fixed Ansible, but it broke git push. That ssh-key is used only for ssh to the clients, and cannot be used for pushing to git. The Ansible configuration lives in a git checkout in that jail, and the key that pushes to the git server is on my laptop. With -a, that key never reached the… Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town