Deploy unable to clone git repo

You could double-check a few things:

  • You have defined your repo, vs left the default (leaving the default has caused the Permission denied error for a user in the past), and have defined it such that it will clone via ssh (vs https):
    Like this: repo: git@bitbucket.org:user/repo.git
    Not this : repo: https://bitbucket.org/user/repo.git

  • Your ansible.cfg isn’t somehow missing this ForwardAgent=yes setting.

  • Your ssh-agent isn’t giving you trouble (e.g., like this) – but I doubt it is because if you’re able to manually clone the repo from the server, your ssh forwarding seems to be working.

You might share a verbose log with us (showing error info) by running the long-form deploy command with the -vvvv flag:
ansible-playbook -i hosts/staging deploy.yml -e "site=mysitename.com" -vvvv

2 Likes