Skip to content

Instantly share code, notes, and snippets.

@mathyourlife
Last active August 29, 2015 14:04
Show Gist options
  • Save mathyourlife/a009bfd3e7549b358b8e to your computer and use it in GitHub Desktop.
Save mathyourlife/a009bfd3e7549b358b8e to your computer and use it in GitHub Desktop.
chef-dk

Steps Used to Configure Ubuntu 14.04 Workstation with Chef-DK and Vagrant

wget https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/chefdk_0.2.0-2_amd64.deb
sudo dpkg -i chefdk_0.2.0-2_amd64.deb
mkdir -p ~/.chefdk
echo 'eval "$(chef shell-init bash)"' >> ~/.bashrc
echo 'export PATH="/opt/chefdk/embedded/bin:${HOME}/.chefdk/gem/ruby/2.1.0/bin:$PATH"' >> ~/.bashrc
wget https://dl.bintray.com/mitchellh/vagrant/vagrant_1.6.3_x86_64.deb
sudo dpkg -i vagrant_1.6.3_x86_64.deb

source ~/.bashrc
gem install bundler

chef generate cookbook my_cookbook
echo 'source "https://rubygems.org"' >> my_cookbook/Gemfile
echo 'gem "test-kitchen", "=1.2.1"' >> my_cookbook/Gemfile
echo 'gem "kitchen-vagrant"' >> my_cookbook/Gemfile
echo 'gem "berkshelf",  "=3.1.4"' >> my_cookbook/Gemfile
cd my_cookbook/
bundle install --path ./vendor/bundle/
bundle exec kitchen list
$ cat Gemfile
source "https://rubygems.org"
gem 'berkshelf',  '=3.1.4'
gem 'test-kitchen', '=1.2.1'
gem 'kitchen-vagrant'
$ cat Berksfile 
source "https://api.berkshelf.com"

metadata
$ cat metadata.rb 
name             'my_cookbook'
maintainer       ''
maintainer_email ''
license          ''
description      'Installs/Configures my_cookbook'
long_description 'Installs/Configures my_cookbook'
version          '0.1.0'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment