I have a working chef server 12.6 installation and a separate berkshelf server and would like to use the chef server universe endpoint as a source in my Berksfile. The release notes for chef server 12.4 (https://docs.chef.io/release_notes_server.html) (two versions older than the chef server I am testing with) suggests that setting the Berkshelf source to “$chefserverurl/universe” should work.
However, I have tried setting the source to: “$chefserverurl”, “$chefserverurl/universe” and :chef_server, but running “berks install” just returns the “Are You Looking For the Chef Server?” page instead of the expected universe. Is this the correct way to use the chef server universe endpoint?
Hi. I am using this endpoint and it works just as expected with
source :chef_server. Do you have chef_server_url, chef_server_root, node_name and client_key set up correctly in your knife.rb? The chef servers universe is different to other berkshelf servers, because it is authenticated and specific to your organization which means you will have to test it with “knife raw /universe”.
You don’t mention which version of berkshelf you’re using. If you have 4.3.0 or later,
source :chef_server is correct.
You can confirm the universe endpoint is working using
knife raw /universe, which should return a big lump of json that describes all your cookbooks.
Thanks for the replies and confirming that it should work.
Berkshelf version is 5.2.0 (chef dk 1.0.3). Other knife commands e.g.
knife status work, so I think my knife.rb settings should work for the authentication part.
The chef server has been upgraded from 12.3 where the chef universe wasn’t available to 12.6.
knife raw /universe currently returns a
404 - not found so it looks like there is a problem, I will carry on digging.
A quick update:
This is now working after another chef-server-ctl reconfigure and updating the chef_server_url in the Berksfile to https://$chef_server_url/organizations/$organization
Thanks for your help.