Permission denied (publickey) when deploy

“Could not read from remote repository”, but I can git push without problems. Are the SSH keys same for GIT and ansible?

Thank you.

TASK [deploy : Clone project files] ********************************************
fatal: [185.14.185.42]: FAILED! => {"changed": false, "cmd": "/usr/bin/git ls-remote origin -h refs/heads/master", "failed": true, "msg": "Permission denied (publickey).\r\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.", "rc": 128, "stderr": "Permission denied (publickey).\r\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.\n", "stdout": "", "stdout_lines": []}

Solved!

ssh-add /Users/aitor/.ssh/id_rsa

sorry about noise

2 Likes