ssh-agent module does error connecting to agent

Skip to first unread message

Frans van Berckel

Mar 20, 2023, 12:55:02 AMMar 20
to Ansible Development
I found by Google and tweaked a bit, but running does ...

$ ansible -vvvvv -m ssh_agent -a 'ssh_key_file=/home/ansible/ssh/rsa_id ssh_env_file=/home/ansible/.ssh-agent-env ssh_passphrase=<redacted>' localhost

localhost | FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "ssh_env_file": "/home/ansible/.ssh-agent-env",
            "ssh_key_file": "/home/ansible/ssh/rsa_id",
            "ssh_passphrase": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER"
    "msg": "Error adding key and passphrase to agent: Error connecting to agent: No such file or directory\n"

To me it looks like the ssh-add can't connect ssh-agent in memory? Or ssh-add doesn't use / can't read ssh_env_file?

~$ ps -A | grep ssh-agent
  35583 ?        00:00:00 ssh-agent

~$ ls .ssh-agent-env

$ cat  .ssh-agent-env
ssh_auth_sock = /tmp/ssh-FwY7QOdRrW6h/agent.35582; export SSH_AUTH_SOCK;
ssh_agent_pid = 35583; export SSH_AGENT_PID;

Any idea what goes wrong?
Reply all
Reply to author
0 new messages