# Ansible ssh-agent check

**URL:** <https://forum.ansible.com/t/ansible-ssh-agent-check/36099>\
**Category:** Ansible Project\
**Created:** [December 10, 2021, 10:44am UTC](https://forum.ansible.com/t/ansible-ssh-agent-check/36099 "2021-12-10T10:44:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neil\_Young](https://avatars.discourse-cdn.com/v4/letter/n/a3d4f5/32.png) [@Neil\_Young](https://forum.ansible.com/u/Neil_Young)\
**Post date:** [December 10, 2021, 10:44am UTC](https://forum.ansible.com/t/ansible-ssh-agent-check/36099/1 "2021-12-10T10:44:46Z")

</div>

Hi,

I’m using the ssh-agent in order to make Ansible aware of my identity during the setup. Unfortunately I mostly forget to run

“ssh-add ~/.ssh/id\_rsa”

before starting lengthy installations, so at some point later for instance a “git clone” fails because auf authentication problems.

Is there a chance to run “ssh-add -l” locally before running the full installation in order to see, if the ssh agent is properly configured?

---

<div class="post-metadata">

**Author:** ![Neil\_Young](https://avatars.discourse-cdn.com/v4/letter/n/a3d4f5/32.png) [@Neil\_Young](https://forum.ansible.com/u/Neil_Young)\
**Post date:** [December 10, 2021, 8:48pm UTC](https://forum.ansible.com/t/ansible-ssh-agent-check/36099/2 "2021-12-10T20:48:33Z")

</div>

- name: Configure SSH agent  
delegate\_to: localhost  
shell: |  
ssh-add ~/.ssh/id\_rsa

Thanks
