Pulling git repo to a vagrant box using ansible -


hi trying pull repo github vagrant box via ansible, refering this github issue. have registered ssh host github. , below part in playbook i'm trying pull;

  - name: install git     apt: name=git    - name: create ssh public key file     copy: src=/home/user/.ssh/id_rsa.pub dest=/root/.ssh/id_rsa.pub mode=0644    - name: create ssh private key file     copy: src=/home/user/.ssh/id_rsa dest=/root/.ssh/id_rsa mode=0600    - name: setup git repo     git: repo=git@github.com:myusername/project_foo_bar.git dest=/home/projects/myproject accept_hostkey=yes key_file="/root/.ssh/id_rsa" 

after installing git i've copied public , private keys box provisioning fails in last step. i'm unable pull repo, instead below error;

task: [setup git repo] ********************************************************  failed: [default] => {"cmd": "/usr/bin/git ls-remote origin -h     refs/heads/master", "failed": true, "rc": 128} stderr: fatal: 'origin' not appear git repository fatal: not read remote repository.  please make sure have correct access rights , repository exists.  msg: fatal: 'origin' not appear git repository fatal: not read remote repository.  please make sure have correct access rights , repository exists.  fatal: hosts have failed -- aborting 

am wrongly entering address. tried repo=ssh://git@github.com/myusername/project_foo_bar.git doesn't fly

you init repository in /home/projects/myproject directory , try clone github repo same directory.

remove init task, delete /home/projects/myproject directory box , run playbook again.


Comments