Chef deploy_resource private repo, ssh deploy keys and ssh_wrapper

后端 未结 2 1878
忘掉有多难
忘掉有多难 2021-02-04 17:26

I\'m having loads of trouble getting my Chef recipe to clone a private repo. Well, I had it working yesterday but after \'cheffin\' my Vagrant box half a dozen times, I\'ve brok

2条回答
  •  孤城傲影
    2021-02-04 17:43

    Your question doesn't have a link to to the deploy_resource source, so I can't be sure if this will apply, but if it uses a git resource underneath, the following might be helpful...

    As described in this answer to a similar question, you can avoid creating extra script files to go with each SSH key by adding the SSH command as an "external transport" part of the repository URL:

    git "/path/to/destination" do
      repository "ext::ssh -i /path/to/.ssh/deployment_key -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no git@github.com %S /my_name/some_repo.git"
      branch "master"
      ...
    end
    

提交回复
热议问题