-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Opscode Chef provides configuration management to your infrastructure.
Make sure you have all the prerequisites to be productive with this Chef repository.
They are easy to uninstall later.
Download the chef-repo
cd ~
mkdir -p chef/cookbooks
cd chef
git clone git://github.com/jeremiahsnapp/chef-repo.git
Setup Librarian - (Bundler for your Chef Cookbooks)
This chef-repo has a ready-to-use Librarian Cheffile.
cd chef-repo
librarian-chef clean
librarian-chef install
(Optional) Create Encrypted Data Bag Key
Uncomment the chef.encrypted_data_bag_secret_key_path
line in Vagrantfile.
mkdir ~/.chef
openssl rand -base64 512 | tr -d '\r\n' > ~/.chef/chef_data_bag_key
Vagrant - (Easily Manages VirtualBox VM's)
This chef-repo has a ready-to-use Vagrantfile. The Vagrantfile will automatically download the appropriate vagrant box when 'vagrant up' is run.
The Vagrantfile is configured to apply the chef-repo/roles/test_chef_solo.rb role run_list which is configured to apply the 'role[web]' which will install and configure many things including:
The first chef-solo run will fail because the preinstalled version of chef in the vm isn't high enough for chef-solo-search cookbook.
vagrant up --no-provision
'vagrant ssh' lets you easily log into the vm but here we will just send the vm a command to update chef so chef-solo-search cookbook will work enabling data bag search within a chef-solo run.
vagrant ssh -c 'sudo gem update chef --no-ri --no-rdoc'
This will take a while but you should see green colored chef output scroll by in your terminal. If you ever see any red colored output then the chef run had some errors.
vagrant provision
Browse to http://127.0.0.1:8080
You should see the vm's web server.
If you change any cookbooks make sure librarian pulls the changes into chef-repo/cookbooks.
librarian-chef clean
librarian-chef install
You could have also just run 'librarian-chef install' to only pull changes instead of starting with a clean slate The choice is yours but sometimes it's nice to be sure everything is up to date from a clean slate
vagrant provision
vagrant halt
vagrant destroy