Reputation: 90211
I'm using vagrant to script deployments, and my provisioning clause in my Vagrantfile
looks like this:
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
The problem is that our Artifactory repository is behind HTTP authentication; running chef-solo gives us a 401 Unauthorized (OpenURI::HTTPError)
error. I tried changing the url to http://user:[email protected]:8081/artifactory/cookbooks/cookbooks.tar.gz
, but it doesn't work.
How can I access a cookbook URL behind HTTP authentication?
Upvotes: 1
Views: 975
Reputation: 16235
Can you pass the credentials in the URL? Something like this:
chef.recipe_url = "https[s]://#{the_user}:#{the_password}@our.server.com:8081/artifactory/cookbooks/cookbooks.tar.gz"
I'm using similar to download using remote_file
.
Upvotes: 1