WARNING: This article can be outdated. Better read my book about Chef: Cooking Infrastructure by Chef
Hello my dear friends. Today we will continue talk about Chef Server (and Solo). In this article I will talk about little update of my Chef Sole and Server code examples.
New Vagrant - new configuration for testing
New version of Vagrant 1.1.x came out. Vagrant can work with VMware (non-free), have system of plugins and changed API. So I updated my Chef Solo and Server code examples.
First of all, now you should install Vagrant by separate installer and shouldn’t use for this bundler. Without this you couldn’t use vagrant plugins. In my examples I removed vagrant from dependency in Gemfile, so you must install it before using my code examples.
Also removed multi_json gem from Gemfile, because Gemfile gems not available in vagrant environment. For parsing JSON data I use json gem, which available in vagrant environment. Code changes:
Next, changed vagrant API in Vagrantfile. Old style is also supported, but I migrated my code examples to new Vagrantfile.
Berkshelf and Vagrant
In berkshelf gem (covered in previous article) moved berkshelf vagrant plugin into it’s own repository. If you want use berkshelf with vagrant you should install it:
More information you can read here.
Right now berkshelf-vagrant not work in “multi-machine” environment (Chef Server code example), but you can solve this by installing cookbooks in “cookbooks” dir before execution commands “vagrant up” or “vagrant provision”:
Problem with nginx and runit cookbooks (be careful)
Nginx and runit cookbooks right now have problems. Better use versions from my Cheffile.lock.
New runit v1.1.0 is invalid (I had error what didn’t found template for ubuntu 12.04) and didn’t work in new cookbook.
Nginx cookbook have also problem: it will not install nginx version from source, which different from default in cookbook. I think this is problem with same keys, used by default and Ohai plugin attributes.
Quick guides of my Chef code examples.
That’s all folks! Thank you for reading till the end.