Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save smford22/5b38ba03febcc8948819 to your computer and use it in GitHub Desktop.
Save smford22/5b38ba03febcc8948819 to your computer and use it in GitHub Desktop.

Download and install

chef-dk

virtual box

vagrant

If you run into problems running chef-dk, maybe check out this blog: sane ruby env blog post

OR

Use the embedded ruby shipped with Chef by updating your PATH

echo 'export PATH="/opt/chefdk/embedded/bin:$PATH"' >> $HOME/.bash_profile

Install kitchen-vagrant gem

$ chef gem install kitchen-vagrant

Local cookbook development workflow

Clone community python cookbook

$ git clone git@github.com:poise/python.git

list test-kitchen VM's

$ cd python

$ kitchen list

add .kitchen.local.yml file with a platform for CentOS 6.5

platforms:
- name: centos-6.5
  driver_config:
    box: opscode-centos-6.5
    box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.5_chef-provisionerless.box

Run VM for CentOS 6.5 and install python 2.7 from source

$ kitchen converge source-centos-65

Log into converged VM and check python version

$ kitchen login source-centos-65

[vagrant@source-centos-65 ~]$ python -v

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment