source "https://rubygems.org"
gem "knife-solo"
gem "berkshelf"
gem install bundler && bundle install
3. Create a new directory structure(i.e. “kitchen”) that fits with Chef's standard structure and can be used to build and store recipes
knife solo init .
berks init .
Script above creates file Berksfile
which contains cookbook dependencies
Example:
source "https://supermarket.chef.io"
metadata
cookbook "mysql"
cookbook "nginx", "~> 2.6"
berks install
This command downloads required cookbooks and store it into cookbooks
directory.
All nodes are located into directory 'nodes'.
knife solo prepare [user]@[node] --forward-agent
Example for staging.com:
knife solo prepare [email protected] --forward-agent
knife solo cook [user]@[node] --forward-agent
Example for staging.com:
knife solo cook [email protected] --forward-agent
Vagrant helps to create virtual host on your local machine which used for emulating external virtual hosts.
vagrant plugin install vagrant-hostsupdater
3. Add dummy box from https://atlas.hashicorp.com/boxes/search
vagrant box add precise32 http://files.vagrantup.com/precise32.box
vagrant box add ubuntu-14.04 https://oss-binaries.phusionpassenger.com/vagrant/boxes/latest/ubuntu-14.04-amd64-vbox.box
This command create local virtual hosts which described into Vagrantfile.
vagrant up