Setting up for infrastructure development

Local MacOSX environment for development and testing with Test Kitchen and Vagrant.



The new stack is made up of:

Mac OS X as a development environment

% xcode-select —install
% ruby -e “$(curl -fsSL

Adding the current configuration development repository

% brew install git

Setting up a local Ruby environment

% brew install rbenv ruby-build 
% rbenv versions 
* system
% rbenv install 2.0.0-p451Installing ruby-2.0.0-p451…
Installed ruby-2.0.0-p451 to […]2.0.0-p451
% rbenv versions
* system
% rbenv local 2.0.0-p451% rbenv rehash% rbenv versions 
* 2.0.0-p451 (set by […]/.ruby-version)
% gem install bundler
% cat Gemfile
ruby ‘2.0.0'
source ‘'gem ‘nokogiri’, ‘~>'
gem ‘json’
gem ‘hashie’
gem ‘chef’
gem ‘test-kitchen’
gem ‘kitchen-vagrant’
gem ‘kitchen-ec2'
gem ‘faraday’gem ‘knife-ec2'
gem ‘knife-solo’
% bundle install —path vendor
% cat bundle_install 
bundle config build.nokogiri —use-system-libraries
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future bundle install —path vendor
Your bundle is complete!
It was installed into ./vendor
% rbenv rehash
% brew install libxml2 libxslt% brew link libxml2 libxslt
% bundle exec ruby -v 
ruby 2.0.0p451 (2014-02-24 revision 45167) [universal.x86_64-darwin13]
% bundle exec gem environmentRubyGems Environment:
 — RUBY VERSION: 2.0.0 (2014-02-24 patchlevel 451) [universal.x86_64-darwin13]
 — INSTALLATION DIRECTORY: […]/vendor/ruby/2.0.0
 — RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
 — EXECUTABLE DIRECTORY: […]/vendor/ruby/2.0.0/bin
 — ruby
 — universal-darwin-13
 —  […]/vendor/ruby/2.0.0
 — :update_sources => true
 — :verbose => true
 — :backtrace => false
 — :bulk_threshold => 1000

Vagrant and VirtualBox

Using Test Kitchen locally

% bundle exec kitchen list
% bundle exec kitchen converge INSTANCE
% bundle exec kitchen verify INSTANCE
% bundle exec kitchen login INSTANCE
% bundle exec kitchen destroy INSTANCE

distributed systems 🚀 ,metrics 📈,clean code 🧐 , automation 🤖.Contracting at the moment @HMRCgovuk

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store