Chef infra 将chef.recipe_url与受密码保护的网站一起使用
我正在使用vagrant编写部署脚本,我的Chef infra 将chef.recipe_url与受密码保护的网站一起使用,chef-infra,vagrant,Chef Infra,Vagrant,我正在使用vagrant编写部署脚本,我的vagrant文件中的provisioning子句如下所示: config.vm.provision :chef_solo do |chef| chef.recipe_url = "http://our.server.com:8081/artifactory/cookbooks/cookbooks.tar.gz" chef.add_recipe "vagrant::vagrant_default" end chef.recipe_url
vagrant文件中的provisioning子句如下所示:
config.vm.provision :chef_solo do |chef|
chef.recipe_url = "http://our.server.com:8081/artifactory/cookbooks/cookbooks.tar.gz"
chef.add_recipe "vagrant::vagrant_default"
end
chef.recipe_url = "https[s]://#{the_user}:#{the_password}@our.server.com:8081/artifactory/cookbooks/cookbooks.tar.gz"
问题是我们的工件库在HTTP认证之后;运行chef solo会给我们一个401unauthorized(OpenURI::HTTPError)
错误。我尝试将url更改为http://user:pass@我们的.server.com:8081/artifactory/cookbooks/cookbooks.tar.gz
,但它不起作用
如何通过HTTP身份验证访问cookbook URL?您可以在URL中传递凭据吗?大概是这样的:
config.vm.provision :chef_solo do |chef|
chef.recipe_url = "http://our.server.com:8081/artifactory/cookbooks/cookbooks.tar.gz"
chef.add_recipe "vagrant::vagrant_default"
end
chef.recipe_url = "https[s]://#{the_user}:#{the_password}@our.server.com:8081/artifactory/cookbooks/cookbooks.tar.gz"
正如问题中提到的,我正在使用类似于使用remote_file
下载的方法尝试了该方法。哦,很抱歉。包含用户和密码的url在web浏览器中有效吗?您尝试过https吗?它在web浏览器中工作。这不是通过https实现的,尽管我们会实现。最终,它可能不被支持。值得在流浪者邮件列表上询问,也许还需要提交一个问题。我相信HTTPS auth会起作用。