Packer template to prepare Chef Development Environment with ChefDK and Docker(kitchen-docker)
You can easily setup Chef Development Environment by the following procedure.
Create Vagrantfile:
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.define :node do |node|
node.vm.box = "tkak/centos-6.6-x86_64-chef-dk"
end
end
Boot VM and SSH login:
$ vagrant up
$ vagrant ssh
Start Chef cookbook development:
i.g.)
$ zsh ## If you want to use zsh
$ git clone https://github.com/tkak/sample-chef-repo.git
$ cd sample-chef-repo
$ kitchen init --driver=kitchen-docker
coding...
$ kitchen test
Box | OS | Tools |
---|---|---|
centos-6.6-x86_64-chef-dk | CentOS 6.6 x86_64 | Docker, ChefDK, kitchen-docker, git, vim, zsh + oh-my-zsh |
ubuntu-14.04-amd64-chef-dk | Ubuntu 14.04 amd64 | Docker, ChefDK, kitchen-docker, git, vim, zsh + oh-my-zsh |
- Virtual Box
- Vagrant
- Packer
Make a vagrant box image by using Packer:
$ git clone [email protected]:tkak/chef-dk-box.git
$ cd packer
$ packer build centos-6.6-x86_64.json
$ vagrant box add centos-6.6-x86_64-chef-dk ../builds/virtualbox/centos-6.6-x86_64-chef-dk.box
$ vagrant box list
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Run style checks and RSpec tests (
bundle exec rake
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request