Skip to content
This repository has been archived by the owner on Mar 19, 2022. It is now read-only.

Upgrading to 0.3.0

Teemu Matilainen edited this page Sep 23, 2013 · 8 revisions

Solo.rb change to avoid using file_cache_path

This change will require altering existing "kitchens" or other repos that you're using with knife-solo.

In previous versions solo.rb was generated as part of the solo init or kitchen commands. This version of solo.rb also overloaded the definition of file_cache_path which caused a number of issues (#1, #86, #125, #128, #177)

Starting from v0.3.0.pre3 knife-solo dynamically generates the solo.rb for the node. The local cookbook, role, etc. directories have to be specified in standard knife configuration (e.g. ./.chef/knife.rb, ~/.chef/knife.rb). The directories are now by default uploaded to ~/chef-solo on the node (to avoid security problems with old default, /tmp/chef-solo). This directory can be specified using knife solo cook --provisioning-path or by knife[:provisioning_path] configuration option in knife.rb.

You can generate a simple ./.chef/knife.rb using knife solo init.

An example knife.rb could look like this:

knife[:provisioning_path] = "/home/user/solo"

cookbook_path ["../common-cookbooks", "site-cookbooks"]
role_path     nil
data_bag_path "data_bags"
encrypted_data_bag_secret "#{ENV['HOME']}/.chef/data_bag_key"

As you can see, the directories and files can now also be outside of the current directory (i.e. "kitchen"). It is also worth noting that the default values provided by Knife/Chef are most probably not what you want, so a custom knife.rb is normally needed.

Removal of librarian-chef dependency

knife-solo 0.3.0 supports both librarian and berkshelf, but neither are required. If you previously used librarian-chef with knife-solo please make sure that your copy of the gem is installed and up to date.

Questions?

If you have any questions on this change please file an issue and we'll do our best to find a solution for you.

Thanks!

Trouble Shooting

Debug output

You can run the knife commands with -VV (yeah, that's two Vs) to get a lot of debug log that could help to reveal what's going on under the hood.

Argh! My kitchen isn't uploading. What gives?

Chances are your kitchen has a knife.rb file in its root path (e.g. my-kitchen/knife.rb). You need to merge this with the .chef/knife.rb file generated by 0.3.0 of this software. Once you do so, your kitchen should upload as expected.