【发布时间】:2016-05-07 16:00:57
【问题描述】:
我可以在 AWS OpsWorks 上使用 Chef 12 克隆公共存储库,如下所示:
execute "get code" do
user "root"
cwd node['conf-cookbook']['project_root']
command "git clone #{app['app_source']['url']}"
end
但我不知道如何使用部署 ssh 密钥来克隆私有存储库 - 我已经搜索了一段时间并看到了一个潜在的解决方案,如下所示:
git node['conf-cookbook']['app_dir'] do
repository "ext::ssh -i #{app['app_source']['ssh_key']} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no #{app['app_source']['url']}"
checkout_branch "master"
action :sync
end
这对错误消息不起作用:
---- Begin output of git ls-remote "ext::ssh -i -----BEGIN RSA PRIVATE KEY----
MIIJKQIBAAKCAgEApaViIRinBrusrE....[key detail]7xAOmo3NAmqcPxdrOI+hZJHh5KRvrQPLHY
-----END RSA PRIVATE KEY----- -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no git@github.com:harrywang/app-main.git" "HEAD" ----
STDOUT:
STDERR: Warning: Identity file -----BEGIN not accessible: No such file or directory.
ssh: Could not resolve hostname rsa: Name or service not known
fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
有什么帮助吗?谢谢!
【问题讨论】:
标签: github ssh chef-infra ssh-keys aws-opsworks