Deployed keys with ansible does still require git's password

Hi,

I am trying to clone a repository on the server from GitLab. I am doing this through Ansible. I have generated a key pair and added the public key to the GitLab Deployed keys and to the authorized_hosts file in /home/vagrant/.ssh/. The private key is on the server I want to clone on.

In Ansible I use the following:

- name: Clone repo/example
  git: repo={{ example_git_repo }}
    dest={{ example_git_destination }} accept_hostkey=true key_file=/home/vagrant/.ssh/id_rsa clone=no update=no

The problem is the following:

Testing the ssh connection with ssh -T git@myserver.com works.

"Welcome to GitLab, Anonymous!

Since it is for deployment only, I don’t expect any particular user instead of anonymous.
When I try to manually git clone the repository I am prompted to enter git’s password although I defined the key in the ansible playbook. Ansible therefore hangs at cloning the repo.

Any help would be highly appreciated.

Can you post how the {{ example_git_repo }} looks like?

Does it use https:// or git@?