2

i am trying to deploy rails app through chef code. recipe contains code

deploy_revision "testapp" do    
  repo "REPO_URL"    
  ssh_wrapper "/home/ubuntu/.ssh/chef_ssh_deploy_wrapper.sh"    
  environment({    
    "RAILS_ENV" => "staging"    
  })    
  deploy_to "/home/ubuntu/testapp"    
  branch "master"    
  user "ubuntu"    
  group "ubuntu"    
  scm_provider Chef::Provider::Git    
end   

and sshwrapper file contains

exec ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no github.com -i "/home/ubuntu/.ssh/id_rsa" "$@"     

when i ran bootstrap

im getting error as follows

STDERR: Warning: Permanently added 'github.com,192.30.252.129' (RSA) to the list of known hosts.
192.168.1.32 Permission denied (publickey).
192.168.1.32 fatal: Could not read from remote repository.
192.168.1.32 Please make sure you have the correct access rights
192.168.1.32 and the repository exists.
192.168.1.32 ---- End output of git ls-remote "REPO_URL" master* ----

so , unable to figure it out the reason. Any help would be appreciated.

StephenKing
  • 36,187
  • 11
  • 83
  • 112
mbdvg
  • 2,614
  • 3
  • 21
  • 39
  • Did you registered an ssh key to your GitHub account, as I just explained in http://stackoverflow.com/a/24277691/6309? – VonC Jun 18 '14 at 05:55
  • yes, i registered . i can clone repo on host machine manually. – mbdvg Jun 18 '14 at 05:59
  • Does chef has access to the same key, in its HOME/.ssh? – VonC Jun 18 '14 at 06:00
  • yes , it is all readable. added 644 permission for config file. – mbdvg Jun 18 '14 at 06:08
  • So it accesses the same HOME as your account? – VonC Jun 18 '14 at 06:09
  • yes . it access the same . it even clone the id_rsa files,config files in ,ssh directory from template. – mbdvg Jun 18 '14 at 06:14
  • 1
    can you clone the repo as `ubuntu` user using the sshwrapper file? – StephenKing Jun 18 '14 at 07:11
  • 1
    got the issue. problem with the wrapper file. thanks StephenKing for the hint. extra string github.com in wrapper file caused the problem. Thanks guys for your help. – mbdvg Jun 18 '14 at 07:17
  • @ManjunathBavihal its probably worth adding an answer for the question which explains that the extra github.com bit in the sshwrapper was wrong. – NikG Aug 01 '15 at 16:41

0 Answers0