qa to sous-chef
DESCRIPTION
This is my experience as a black box test engineer venturing into Devops using Chef. I cover the following topics during the course of my presentation - Why Chef, Pre-requisites, Cooking on a vagrant VM and conclude with an introduction to Berkshelf.TRANSCRIPT
QA to sous-ChefSajnikanth Suriyanarayanan
Presented at Devops Summit on 27th March 2014& at DevopsSG on 2nd October 2013
About Me● Coastal GeoScientist and Civil Engineer● 10+ years in Software Quality Assurance
and Functional Testing● HP Certified Professional in Quality Center● Lead Quality Assurance at Vistaprint● http://sajnikanth.com
● I’m a beginner● May not be the standard way
● introduction to vagrant● introduction to chef provisioning● introduction to berkshelf
Disclaimer & Take-Away
Contents● Background● Problem● Vagrant + bash● Vagrant + Chef● Demo● Lessons Learned
BackgroundAs Test Engineer, I usually:
● write test scripts● merge pull requests● deploy code● test changes
ProblemCurrent project is brand new. So:
● write test scripts● merge pull requests● deploy code (where to?)● test changes
● App lives locally● Experiment with technologies (mysql or
mongoDB; apache or nginx;)● Unstable environment
Problem ...
A server should be like a phoenix, regularly rising from the ashes - Martin Fowler
Vagrant + bash
● Reproducible● Portable● Isolated; room for experimentation● Use Bash to install apps 'automatically'
Vagrant + bash ...Changing / maintaining bash scripts?
Vagrant + ChefApprehensions:● Ruby● Steep learning curve
○ hosted chef or chef solo○ knife○ opscode○ cookbooks○ recipe○ omnibus○ information overload!!
Forget it!Let’s get our hands dirty
Install nginx on vagrant VM using Chef
Pre-Requisites● VirtualBox● vagrant installed● vagrant omnibus● vagrant guest additions● knife
Demo
vagrant init
Demo - Initialize vagrant
Demo - Create Cookbooksmkdir ./cookbooksknife cookbook site download nginxUnarchive and delete tar
Demo - Update Vagrantfile
Demo - Let’s cookvagrant up
Demo - Results?
Demo - Download apt cookbookknife cookbook site download apt
Demo - Update Vagrantfile
Demo - We try againvagrant up
Cookbook bluepill not foundCookbook rsyslog not foundCookbook build-essential not foundCookbook ohai not foundCookbook runit not foundCookbook yum not foundCookbook yum-epel not found
Demo - Download cookbooks
Demo - Update Vagrantfile
Hungry Already?
Demo - and againvagrant up
Easy way to manage cookbooks
gem install berkshelfvagrant plugin install vagrant-berkshelf
Demo - enter Berkshelf
cookbook 'nginx'
Demo - Berksfile
berks install
Demo - using berkshelf
~/.berkshelf/cookbooks/
Demo - update Vagrantfileupdate Vagrantfile to use berkshelfvagrant reload
Demo - Results
Demo - Resources
● Presentation link - http://j.mp/devops-summit● Demo repo - https://github.com/sajnikanth/chef-berkshelf-demo● Chef Tutorials
○ http://nathenharvey.com/blog/2012/12/06/learning-chef-part-1/○ https://learnchef.opscode.com/quickstart/
● Berkshelf Introduction - http://youtu.be/hYt0E84kYUI
3 Important lessons learned while using chef
● RTFM● RTFM● RTFM
Lessons Learned
Questions?