Search code examples
chef-infrachef-soloberkshelf

Is there a quick way to use chef cookbooks on github?


Is there a quick way to use chef cookbooks on github?
I'm trying: chef-solo -r https://github.com/phlipper/chef-htop/archive/master.tar.gz -o htop but I'm getting a ruby error.
Is doing what I want to do possible?

Edit: Quickest way I've found is:

cd /tmp 
wget https://github.com/phlipper/chef-htop/archive/master.tar.gz
tar xzvf master.tar.gz 
mkdir -p /var/chef/cookbooks
cd chef-htop-master
berks vendor /var/chef/cookbooks
chef-solo -o htop

I feel like the use of Berkshelf is an issue here.

Edit: To clarify my goal, I'd like to be able to leverage chef and the community when I want to install software on a platform I am not familiar with.


Solution

  • The fast way would be to use Berkshelf and then berks vendor. In days long past you could use archives like that, but I think it was only zip files and I'm pretty sure most of that support was removed, and it wouldn't have worked with the layout from GitHub archive downloads to start with.

    Create a new Berksfile with content like:

    source 'https://supermarket.chef.io/'
    cookbook 'htop'
    

    And then run berks install && berks vendor cookbooks/. This will create a solo-compatible cookbooks folder. You'll still need to fill in the node JSON and solo.rb config though.