SlideShare a Scribd company logo
1
v1.1.0 
Building Testable 
Infrastructure with Chef, Test 
Kitchen, and Docker 
mandi walls 
mandi@getchef.com 
CodeMesh.io 5 November 2014 
2
whoami 
• Mandi Walls 
• Professional Services at Chef 
• @lnxchk 
3
v1.1.0 
What is Chef 
4
Automation Platform 
• Creates a dependable view of your entire network’s 
state. 
• Can handle complex dependencies among the 
nodes of your network. 
• Is fault tolerant. 
• Is secure. 
• Can handle multiple platforms 
• Can manage cloud resources 
• Provides a foundation for innovation 
5
6
Infrastructure As Code 
• Programmatically 
provision and configure 
components 
• Treat like any other 
code base 
• Reconstruct business 
from code repository, 
data backup, and 
compute resources 
7
Policy-Based 
•You capture the policy for your infrastructure 
in code 
•Chef ensures each node in your 
infrastructure complies with the policy 
8
v1.1.0 
Our Goals 
9
Reliable, Repeatable Infrastructure 
• Everyone on the team gets the same config 
• Minimize surprises at deploy time 
• Test app code against real config 
• Test config with the app code 
10
Testing Chef 
• Chef is built on ruby 
• Test chef code with ruby tools like rspec 
• Integrate with Test Kitchen, ServerSpec, foodcritic 
11
v1.1.0 
My Tools 
12
Components of Workflow 
• My workstation - 3 year old mba 
• git, github repo 
• chefdk from downloads.getchef.com 
• Cloud box - CentOS 6.something 
• docker-io installed from peel 
• chefdk from downloads.getchef.com 
• kitchen-docker gem 
• git 
13
How I’m Working 
• Edit recipe code on my machine 
• my nice editor settings, not much RAM 
• Run local tests - syntax, style, lint, chef spec 
• Check into git, upload to repo 
• git pull on test box 
• kitchen converge, kitchen verify, kitchen test 
14
Simple Chef Recipe 
15 
package "httpd" 
! 
service "httpd" do 
action :start 
end 
! 
file "/var/www/html/index.html" do 
content "<h1>hello world</h1>n" 
end
v1.1.0 
What is Test Kitchen 
16
Test Kitchen 
• If Chef is code, we should be able to test it 
17
Test Kitchen 
•Test harness to execute code on one or more 
platforms 
•Driver plugins to allow your code to run on 
various cloud and virtualization providers 
•Includes support for many testing 
frameworks 
•Included with ChefDK 
18
.kitchen.yml 
•The configuration file for your Test Kitchen 
• driver – virtualization or cloud provider 
•provisioner – application to configure the node 
•platforms – target operating systems 
•suites – target configurations 
19
.kitchen.yml 
20 
--- 
driver: 
name: docker 
! 
provisioner: 
name: chef_zero 
! 
platforms: 
- name: centos-6.4 
driver_config: 
forward: 
- 80:80 
! 
suites: 
- name: default 
run_list: 
- recipe[apache::default] 
attributes:
.kitchen.yml 
• Create a docker container 
• With centos-6.4 
• I’m testing a webapp, so forward port 80 
• Provisions our environment with an apache 
webserver as configured by our team in a Chef 
recipe 
21
kitchen create 
-----> Creating <default-centos-64>...! 
build context to Docker daemon 2.048 kB! 
Sending build context to Docker daemon! 
Step 0 : FROM centos:centos6! 
Pulling repository centos! 
---> 70441cac1ed5! 
Step 1 : RUN yum clean all! 
---> Running in b4ed54c86150! 
Loaded plugins: fastestmirror! 
Cleaning repos: base extras updates! 
Cleaning up Everything! 
---> 1c333241ae96! 
Removing intermediate container b4ed54c86150! 
Step 2 : RUN yum install -y sudo openssh-server openssh-clients which curl 
22
docker ps 
[chef@CentOS63 codemesh]$ sudo docker ps! 
CONTAINER ID IMAGE COMMAND CREATED 
STATUS PORTS NAMES! 
9ddd3300de51 87f714782104 "/usr/sbin/sshd -D - 2 minutes ago 
Up 2 minutes 0.0.0.0:80->80/tcp, 0.0.0.0:49157->22/tcp stoic_euclid 
23
kitchen converge 
- install version 2.2.15-39.el6.centos of package httpd! 
! 
* service[httpd] action start [2014-11-05T00:18:29+00:00] INFO: Processing 
service[httpd] action start (codemesh::default line 16)! 
[2014-11-05T00:18:29+00:00] INFO: service[httpd] started! 
! 
- start service service[httpd]! 
! 
* service[httpd] action enable [2014-11-05T00:18:29+00:00] INFO: Processing service[httpd] 
action enable (codemesh::default line 16)! 
[2014-11-05T00:18:29+00:00] INFO: service[httpd] enabled! 
! 
- enable service service[httpd]! 
! 
* file[/var/www/html/index.html] action create [2014-11-05T00:18:29+00:00] INFO: 
Processing file[/var/www/html/index.html] action create (codemesh::default line 20)! 
[2014-11-05T00:18:29+00:00] INFO: file[/var/www/html/index.html] created file /var/www/ 
html/index.html! 
24
kitchen list 
[chef@CentOS63 codemesh]$ kitchen list! 
Instance Driver Provisioner Last Action! 
default-centos-64 Docker ChefZero Converged! 
25
show me 
[chef@CentOS63 codemesh]$ curl localhost! 
<h1>hello world</h1>! 
[chef@CentOS63 codemesh]$ 
26
Other Plugins 
• kitchen-vagrant (included!)! 
• kitchen-docker! 
• kitchen-ec2! 
• kitchen-rackspace! 
• kitchen-gce! 
• kitchen-digitalocean! 
• kitchen-openstack! 
• kitchen-bluebox! 
• kitchen-joyent! 
• kitchen-lxc 
27
Reliable Configuration 
• Provision onto platforms that match production 
• Write Chef recipes once for everyone 
• Local development work 
• Testing systems 
• Production 
• Customize environments as necessary 
• ports, user accounts, backend services 
28
v1.1.0 
TDI: Test-Driven 
Infrastructure 
29
Testing Bits for Chef 
• Pre-testing (no running host) 
• rubocop: ruby style and syntax 
• ChefSpec: chef-specific unit testing 
• foodcritic: chef-specific logic and style rules 
• Post-testing (on a running host) 
• ServerSpec: integration testing on services 
• bats: unix system testing 
30
rubocop 
$ rubocop recipes/default.rb ! 
Inspecting 1 file! 
C! 
Offenses:! 
recipes/default.rb:17:11: C: Space inside square brackets detected.! 
action [ :start, :enable ]! 
^! 
recipes/default.rb:17:27: C: Space inside square brackets detected.! 
action [ :start, :enable ]! 
^! 
recipes/default.rb:20:6: C: Prefer single-quoted strings when you don't need 
string interpolation or special symbols.! 
file "/var/www/html/index.html" do! 
^^^^^^^^^^^^^^^^^^^^^^^^^^! 
1 file inspected, 3 offenses detected 
31
fix 
$ rubocop recipes/default.rb ! 
Inspecting 1 file! 
.! 
! 
1 file inspected, no offenses detected 
32
ChefSpec 
• Test the intention of your code 
• Built on rspec 
• Specific to Chef 
33
Methods 
• You can TDD infrastructure code 
• Keep on top of regressions 
• Give safe configurations to the whole team 
34
chefspec file 
require 'chefspec'! 
! 
describe 'codemesh::default' do! 
let(:chef_run) do! 
ChefSpec::Runner.new.converge(described_recipe)! 
end ! 
! 
it 'installs apache' do! 
expect(chef_run).to install_package('httpd')! 
end ! 
end! 
35
Run chefspec 
$ rspec spec/unit/default.rb ! 
.! 
! 
Finished in 0.00735 seconds (files 
took 1.85 seconds to load)! 
1 example, 0 failures! 
36
ServerSpec 
• Tests running systems 
• Run from Test Kitchen at the end of kitchen 
converge 
• Not dependent on Chef! 
• Use from other config tools 
• Use standalone! 
• serverspec.org 
37
Serverspec File 
require 'serverspec'! 
! 
set :backend, :exec! 
! 
describe 'apache' do! 
it "is installed" do! 
expect(package 'httpd').to 
be_installed! 
end ! 
it "is running" do! 
expect(service 'httpd').to be_running! 
end ! 
it "is listening on port 80" do! 
expect(port 80).to be_listening! 
end ! 
38 
it "displays a custom home page" 
do! 
expect(command("curl 
localhost").stdout).to match / 
hello/! 
end ! 
end!
kitchen verify 
apache! 
is installed! 
is running! 
is listening on port 80! 
displays a custom home page! 
! 
Finished in 1.45 seconds (files took 0.6278 seconds to 
load)! 
4 examples, 0 failures! 
Finished verifying <default-centos-64> (0m18.23s).! 
-----> Kitchen is finished. (0m39.50s)! 
39
test vs verify 
• kitchen verify will run tests on an instance that is 
already running 
• kitchen test will start a new instance, run all the 
chef recipes, run all the tests, and then destroy the 
instance 
• nice for different workflow - user watching a test vs a 
build server watching for a good return code 
• fast with Docker! 
40
v1.1.0 
Further Resources 
41
Container Ecosystem 
• Chef container resources help you manage 
container workflow 
• Create and deploy images 
• https://docs.getchef.com/containers.html 
42
Testing Tools 
• ChefSpec: https://docs.getchef.com/chefspec.html 
• Serverspec: http://serverspec.org/ 
• bats: https://github.com/sstephenson/bats 
• Foodcritic: 
• More on ChefDK: 
• http://foodfightshow.org/2014/08/chefdk.html 
• More on this workflow: 
• http://www.slideshare.net/misheska/testing-yourautomationcode- 
docker-version-v02 
43
Some URLs 
• http://getchef.com 
• http://docs.getchef.com 
• http://supermarket.getchef.com 
• http://youtube.com/getchef 
• http://lists.opscode.com 
• irc.freenode.net: #chef, #chef-hacking 
• Twitter: @chef #getchef, @learnchef #learnchef 
•Meetups in your city?!? 
44
v1.1.0 
Questions? 
45
46

More Related Content

What's hot

London Hashicorp Meetup #8 - Testing Programmable Infrastructure By Matt Long
London Hashicorp Meetup #8 -  Testing Programmable Infrastructure By Matt LongLondon Hashicorp Meetup #8 -  Testing Programmable Infrastructure By Matt Long
London Hashicorp Meetup #8 - Testing Programmable Infrastructure By Matt Long
OpenCredo
 
Docker
DockerDocker
Docker
Michael Lihs
 
2019 Chef InSpec Jumpstart Part 2 of 2
2019 Chef InSpec Jumpstart Part 2 of 22019 Chef InSpec Jumpstart Part 2 of 2
2019 Chef InSpec Jumpstart Part 2 of 2
Larry Eichenbaum
 
Baking docker using chef
Baking docker using chefBaking docker using chef
Baking docker using chef
Mukta Aphale
 
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
Chef
 
Vagrant and Chef on FOSSASIA 2014
Vagrant and Chef on FOSSASIA 2014Vagrant and Chef on FOSSASIA 2014
Vagrant and Chef on FOSSASIA 2014
Michael Lihs
 
Automated Infrastructure Testing
Automated Infrastructure TestingAutomated Infrastructure Testing
Automated Infrastructure Testing
Ranjib Dey
 
Michelin Starred Cooking with Chef
Michelin Starred Cooking with ChefMichelin Starred Cooking with Chef
Michelin Starred Cooking with Chef
Jon Cowie
 
Server Installation and Configuration with Chef
Server Installation and Configuration with ChefServer Installation and Configuration with Chef
Server Installation and Configuration with Chef
Raimonds Simanovskis
 
2019 Chef InSpec Jumpstart Part 1 of 2
2019 Chef InSpec Jumpstart Part 1 of 22019 Chef InSpec Jumpstart Part 1 of 2
2019 Chef InSpec Jumpstart Part 1 of 2
Larry Eichenbaum
 
Automate your Development Environment with Vagrant & Chef
Automate your Development Environment with Vagrant & ChefAutomate your Development Environment with Vagrant & Chef
Automate your Development Environment with Vagrant & Chef Michael Lihs
 
Compliance as Code
Compliance as CodeCompliance as Code
Compliance as Code
Matt Ray
 
Lessons from Etsy: Avoiding Kitchen Nightmares - #ChefConf 2012
Lessons from Etsy: Avoiding Kitchen Nightmares - #ChefConf 2012Lessons from Etsy: Avoiding Kitchen Nightmares - #ChefConf 2012
Lessons from Etsy: Avoiding Kitchen Nightmares - #ChefConf 2012
Patrick McDonnell
 
Chef Fundamentals Training Series Module 2: Workstation Setup
Chef Fundamentals Training Series Module 2: Workstation SetupChef Fundamentals Training Series Module 2: Workstation Setup
Chef Fundamentals Training Series Module 2: Workstation Setup
Chef Software, Inc.
 
Test Driven Infrastructure with Docker, Test Kitchen and Serverspec
Test Driven Infrastructure with Docker, Test Kitchen and ServerspecTest Driven Infrastructure with Docker, Test Kitchen and Serverspec
Test Driven Infrastructure with Docker, Test Kitchen and Serverspec
Yury Tsarev
 
Compliance Automation with Inspec Part 4
Compliance Automation with Inspec Part 4Compliance Automation with Inspec Part 4
Compliance Automation with Inspec Part 4
Chef
 
Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015
Jennifer Davis
 
Using Nagios with Chef
Using Nagios with ChefUsing Nagios with Chef
Using Nagios with Chef
Bryan McLellan
 
Introduction to Chef - Techsuperwomen Summit
Introduction to Chef - Techsuperwomen SummitIntroduction to Chef - Techsuperwomen Summit
Introduction to Chef - Techsuperwomen Summit
Jennifer Davis
 
Node setup, resource, and recipes - Fundamentals Webinar Series Part 2
Node setup, resource, and recipes - Fundamentals Webinar Series Part 2Node setup, resource, and recipes - Fundamentals Webinar Series Part 2
Node setup, resource, and recipes - Fundamentals Webinar Series Part 2
Chef
 

What's hot (20)

London Hashicorp Meetup #8 - Testing Programmable Infrastructure By Matt Long
London Hashicorp Meetup #8 -  Testing Programmable Infrastructure By Matt LongLondon Hashicorp Meetup #8 -  Testing Programmable Infrastructure By Matt Long
London Hashicorp Meetup #8 - Testing Programmable Infrastructure By Matt Long
 
Docker
DockerDocker
Docker
 
2019 Chef InSpec Jumpstart Part 2 of 2
2019 Chef InSpec Jumpstart Part 2 of 22019 Chef InSpec Jumpstart Part 2 of 2
2019 Chef InSpec Jumpstart Part 2 of 2
 
Baking docker using chef
Baking docker using chefBaking docker using chef
Baking docker using chef
 
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
 
Vagrant and Chef on FOSSASIA 2014
Vagrant and Chef on FOSSASIA 2014Vagrant and Chef on FOSSASIA 2014
Vagrant and Chef on FOSSASIA 2014
 
Automated Infrastructure Testing
Automated Infrastructure TestingAutomated Infrastructure Testing
Automated Infrastructure Testing
 
Michelin Starred Cooking with Chef
Michelin Starred Cooking with ChefMichelin Starred Cooking with Chef
Michelin Starred Cooking with Chef
 
Server Installation and Configuration with Chef
Server Installation and Configuration with ChefServer Installation and Configuration with Chef
Server Installation and Configuration with Chef
 
2019 Chef InSpec Jumpstart Part 1 of 2
2019 Chef InSpec Jumpstart Part 1 of 22019 Chef InSpec Jumpstart Part 1 of 2
2019 Chef InSpec Jumpstart Part 1 of 2
 
Automate your Development Environment with Vagrant & Chef
Automate your Development Environment with Vagrant & ChefAutomate your Development Environment with Vagrant & Chef
Automate your Development Environment with Vagrant & Chef
 
Compliance as Code
Compliance as CodeCompliance as Code
Compliance as Code
 
Lessons from Etsy: Avoiding Kitchen Nightmares - #ChefConf 2012
Lessons from Etsy: Avoiding Kitchen Nightmares - #ChefConf 2012Lessons from Etsy: Avoiding Kitchen Nightmares - #ChefConf 2012
Lessons from Etsy: Avoiding Kitchen Nightmares - #ChefConf 2012
 
Chef Fundamentals Training Series Module 2: Workstation Setup
Chef Fundamentals Training Series Module 2: Workstation SetupChef Fundamentals Training Series Module 2: Workstation Setup
Chef Fundamentals Training Series Module 2: Workstation Setup
 
Test Driven Infrastructure with Docker, Test Kitchen and Serverspec
Test Driven Infrastructure with Docker, Test Kitchen and ServerspecTest Driven Infrastructure with Docker, Test Kitchen and Serverspec
Test Driven Infrastructure with Docker, Test Kitchen and Serverspec
 
Compliance Automation with Inspec Part 4
Compliance Automation with Inspec Part 4Compliance Automation with Inspec Part 4
Compliance Automation with Inspec Part 4
 
Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015
 
Using Nagios with Chef
Using Nagios with ChefUsing Nagios with Chef
Using Nagios with Chef
 
Introduction to Chef - Techsuperwomen Summit
Introduction to Chef - Techsuperwomen SummitIntroduction to Chef - Techsuperwomen Summit
Introduction to Chef - Techsuperwomen Summit
 
Node setup, resource, and recipes - Fundamentals Webinar Series Part 2
Node setup, resource, and recipes - Fundamentals Webinar Series Part 2Node setup, resource, and recipes - Fundamentals Webinar Series Part 2
Node setup, resource, and recipes - Fundamentals Webinar Series Part 2
 

Viewers also liked

Role of Pipelines in Continuous Delivery
Role of Pipelines in Continuous DeliveryRole of Pipelines in Continuous Delivery
Role of Pipelines in Continuous Delivery
Mandi Walls
 
Chef - Infrastructure Automation for the Masses
Chef - Infrastructure Automation for the Masses�Chef - Infrastructure Automation for the Masses�
Chef - Infrastructure Automation for the Masses
Sai Perchard
 
Testing Your Automation Code (Docker Version)
Testing Your Automation Code (Docker Version)Testing Your Automation Code (Docker Version)
Testing Your Automation Code (Docker Version)
Mischa Taylor
 
Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to Chef
kevsmith
 
Velocity2011 chef-workshop
Velocity2011 chef-workshopVelocity2011 chef-workshop
Velocity2011 chef-workshop
jtimberman
 
IT Automation with Chef
IT Automation with ChefIT Automation with Chef
IT Automation with Chef
Anuchit Chalothorn
 
Cook Infrastructure with chef -- Justeat.IN
Cook Infrastructure with chef  -- Justeat.INCook Infrastructure with chef  -- Justeat.IN
Cook Infrastructure with chef -- Justeat.IN
Rajesh Hegde
 
Devops madrid: successful case in AWS
Devops madrid: successful case in AWSDevops madrid: successful case in AWS
Devops madrid: successful case in AWS
Juan Vicente Herrera Ruiz de Alejo
 
Infrastructure as Code with Chef
Infrastructure as Code with ChefInfrastructure as Code with Chef
Infrastructure as Code with Chef
Sarah Hynes Cheney
 
Infrastructure Automation with Chef & Ansible
Infrastructure Automation with Chef & AnsibleInfrastructure Automation with Chef & Ansible
Infrastructure Automation with Chef & Ansible
wajrcs
 
Chef introduction
Chef introductionChef introduction
Chef introduction
FENG Zhichao
 
Introducing Chef | An IT automation for speed and awesomeness
Introducing Chef | An IT automation for speed and awesomenessIntroducing Chef | An IT automation for speed and awesomeness
Introducing Chef | An IT automation for speed and awesomeness
Ramit Surana
 
DevOps and Chef improve your life
DevOps and Chef improve your life DevOps and Chef improve your life
DevOps and Chef improve your life
Juan Vicente Herrera Ruiz de Alejo
 
Infrastructure Automation with Chef
Infrastructure Automation with ChefInfrastructure Automation with Chef
Infrastructure Automation with Chef
Jonathan Weiss
 
Overview of chef ( Infrastructure as a Code )
Overview of chef ( Infrastructure as a Code )Overview of chef ( Infrastructure as a Code )
Overview of chef ( Infrastructure as a Code )
Pravin Mishra
 
Testing as a container
Testing as a containerTesting as a container
Testing as a container
Irfan Ahmad
 
Chef Cookbook Testing and Continuous Integration
Chef Cookbook Testing and Continuous IntegrationChef Cookbook Testing and Continuous Integration
Chef Cookbook Testing and Continuous Integration
Julian Dunn
 

Viewers also liked (20)

Role of Pipelines in Continuous Delivery
Role of Pipelines in Continuous DeliveryRole of Pipelines in Continuous Delivery
Role of Pipelines in Continuous Delivery
 
Chef - Infrastructure Automation for the Masses
Chef - Infrastructure Automation for the Masses�Chef - Infrastructure Automation for the Masses�
Chef - Infrastructure Automation for the Masses
 
Testing Your Automation Code (Docker Version)
Testing Your Automation Code (Docker Version)Testing Your Automation Code (Docker Version)
Testing Your Automation Code (Docker Version)
 
Chef For OpenStack Overview
Chef For OpenStack OverviewChef For OpenStack Overview
Chef For OpenStack Overview
 
Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to Chef
 
Velocity2011 chef-workshop
Velocity2011 chef-workshopVelocity2011 chef-workshop
Velocity2011 chef-workshop
 
IT Automation with Chef
IT Automation with ChefIT Automation with Chef
IT Automation with Chef
 
Infrastructure as Code with Chef / Puppet
Infrastructure as Code with Chef / PuppetInfrastructure as Code with Chef / Puppet
Infrastructure as Code with Chef / Puppet
 
Cook Infrastructure with chef -- Justeat.IN
Cook Infrastructure with chef  -- Justeat.INCook Infrastructure with chef  -- Justeat.IN
Cook Infrastructure with chef -- Justeat.IN
 
Chef
ChefChef
Chef
 
Devops madrid: successful case in AWS
Devops madrid: successful case in AWSDevops madrid: successful case in AWS
Devops madrid: successful case in AWS
 
Infrastructure as Code with Chef
Infrastructure as Code with ChefInfrastructure as Code with Chef
Infrastructure as Code with Chef
 
Infrastructure Automation with Chef & Ansible
Infrastructure Automation with Chef & AnsibleInfrastructure Automation with Chef & Ansible
Infrastructure Automation with Chef & Ansible
 
Chef introduction
Chef introductionChef introduction
Chef introduction
 
Introducing Chef | An IT automation for speed and awesomeness
Introducing Chef | An IT automation for speed and awesomenessIntroducing Chef | An IT automation for speed and awesomeness
Introducing Chef | An IT automation for speed and awesomeness
 
DevOps and Chef improve your life
DevOps and Chef improve your life DevOps and Chef improve your life
DevOps and Chef improve your life
 
Infrastructure Automation with Chef
Infrastructure Automation with ChefInfrastructure Automation with Chef
Infrastructure Automation with Chef
 
Overview of chef ( Infrastructure as a Code )
Overview of chef ( Infrastructure as a Code )Overview of chef ( Infrastructure as a Code )
Overview of chef ( Infrastructure as a Code )
 
Testing as a container
Testing as a containerTesting as a container
Testing as a container
 
Chef Cookbook Testing and Continuous Integration
Chef Cookbook Testing and Continuous IntegrationChef Cookbook Testing and Continuous Integration
Chef Cookbook Testing and Continuous Integration
 

Similar to Testable Infrastructure with Chef, Test Kitchen, and Docker

Testing your-automation-code (vagrant version) v0.2
Testing your-automation-code (vagrant version) v0.2Testing your-automation-code (vagrant version) v0.2
Testing your-automation-code (vagrant version) v0.2
Sylvain Tissot
 
Chef Cookbook Workflow
Chef Cookbook WorkflowChef Cookbook Workflow
Chef Cookbook Workflow
Amazon Web Services
 
Testing Your Automation Code (Vagrant Version)
Testing Your Automation Code (Vagrant Version)Testing Your Automation Code (Vagrant Version)
Testing Your Automation Code (Vagrant Version)
Mischa Taylor
 
Node object and roles - Fundamentals Webinar Series Part 3
Node object and roles - Fundamentals Webinar Series Part 3Node object and roles - Fundamentals Webinar Series Part 3
Node object and roles - Fundamentals Webinar Series Part 3
Chef
 
SCALE12X: Chef for OpenStack
SCALE12X: Chef for OpenStackSCALE12X: Chef for OpenStack
SCALE12X: Chef for OpenStack
Matt Ray
 
The Environment Restaurant
The Environment RestaurantThe Environment Restaurant
The Environment Restaurant
Martin de Keijzer
 
Introduction To Continuous Compliance & Remediation
Introduction To Continuous Compliance & RemediationIntroduction To Continuous Compliance & Remediation
Introduction To Continuous Compliance & Remediation
Nicole Johnson
 
Azure handsonlab
Azure handsonlabAzure handsonlab
Azure handsonlab
Chef
 
Introduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to ChefIntroduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to Chef
All Things Open
 
Chef: Smart infrastructure automation
Chef: Smart infrastructure automationChef: Smart infrastructure automation
Chef: Smart infrastructure automation
Johannes H. P. Skov Frandsen
 
Compliance Automation with InSpec - Chef NYC Meetup - April 2017
Compliance Automation with InSpec - Chef NYC Meetup - April 2017Compliance Automation with InSpec - Chef NYC Meetup - April 2017
Compliance Automation with InSpec - Chef NYC Meetup - April 2017
adamleff
 
Automated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. AnsibleAutomated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. Ansible
Alberto Molina Coballes
 
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
Chef Software, Inc.
 
Adding Security to Your Workflow with InSpec (MAY 2017)
Adding Security to Your Workflow with InSpec (MAY 2017)Adding Security to Your Workflow with InSpec (MAY 2017)
Adding Security to Your Workflow with InSpec (MAY 2017)
Mandi Walls
 
OSDC 2017 - Mandi Walls - Building security into your workflow with inspec
OSDC 2017 - Mandi Walls - Building security into your workflow with inspecOSDC 2017 - Mandi Walls - Building security into your workflow with inspec
OSDC 2017 - Mandi Walls - Building security into your workflow with inspec
NETWAYS
 
Practical introduction to dev ops with chef
Practical introduction to dev ops with chefPractical introduction to dev ops with chef
Practical introduction to dev ops with chefLeanDog
 
OSDC 2017 | Building Security Into Your Workflow with InSpec by Mandi Walls
OSDC 2017 | Building Security Into Your Workflow with InSpec by Mandi WallsOSDC 2017 | Building Security Into Your Workflow with InSpec by Mandi Walls
OSDC 2017 | Building Security Into Your Workflow with InSpec by Mandi Walls
NETWAYS
 
Introduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to ChefIntroduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to Chef
Nathen Harvey
 
Prescriptive System Security with InSpec
Prescriptive System Security with InSpecPrescriptive System Security with InSpec
Prescriptive System Security with InSpec
All Things Open
 
Prescriptive Security with InSpec - All Things Open 2019
Prescriptive Security with InSpec - All Things Open 2019Prescriptive Security with InSpec - All Things Open 2019
Prescriptive Security with InSpec - All Things Open 2019
Mandi Walls
 

Similar to Testable Infrastructure with Chef, Test Kitchen, and Docker (20)

Testing your-automation-code (vagrant version) v0.2
Testing your-automation-code (vagrant version) v0.2Testing your-automation-code (vagrant version) v0.2
Testing your-automation-code (vagrant version) v0.2
 
Chef Cookbook Workflow
Chef Cookbook WorkflowChef Cookbook Workflow
Chef Cookbook Workflow
 
Testing Your Automation Code (Vagrant Version)
Testing Your Automation Code (Vagrant Version)Testing Your Automation Code (Vagrant Version)
Testing Your Automation Code (Vagrant Version)
 
Node object and roles - Fundamentals Webinar Series Part 3
Node object and roles - Fundamentals Webinar Series Part 3Node object and roles - Fundamentals Webinar Series Part 3
Node object and roles - Fundamentals Webinar Series Part 3
 
SCALE12X: Chef for OpenStack
SCALE12X: Chef for OpenStackSCALE12X: Chef for OpenStack
SCALE12X: Chef for OpenStack
 
The Environment Restaurant
The Environment RestaurantThe Environment Restaurant
The Environment Restaurant
 
Introduction To Continuous Compliance & Remediation
Introduction To Continuous Compliance & RemediationIntroduction To Continuous Compliance & Remediation
Introduction To Continuous Compliance & Remediation
 
Azure handsonlab
Azure handsonlabAzure handsonlab
Azure handsonlab
 
Introduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to ChefIntroduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to Chef
 
Chef: Smart infrastructure automation
Chef: Smart infrastructure automationChef: Smart infrastructure automation
Chef: Smart infrastructure automation
 
Compliance Automation with InSpec - Chef NYC Meetup - April 2017
Compliance Automation with InSpec - Chef NYC Meetup - April 2017Compliance Automation with InSpec - Chef NYC Meetup - April 2017
Compliance Automation with InSpec - Chef NYC Meetup - April 2017
 
Automated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. AnsibleAutomated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. Ansible
 
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
 
Adding Security to Your Workflow with InSpec (MAY 2017)
Adding Security to Your Workflow with InSpec (MAY 2017)Adding Security to Your Workflow with InSpec (MAY 2017)
Adding Security to Your Workflow with InSpec (MAY 2017)
 
OSDC 2017 - Mandi Walls - Building security into your workflow with inspec
OSDC 2017 - Mandi Walls - Building security into your workflow with inspecOSDC 2017 - Mandi Walls - Building security into your workflow with inspec
OSDC 2017 - Mandi Walls - Building security into your workflow with inspec
 
Practical introduction to dev ops with chef
Practical introduction to dev ops with chefPractical introduction to dev ops with chef
Practical introduction to dev ops with chef
 
OSDC 2017 | Building Security Into Your Workflow with InSpec by Mandi Walls
OSDC 2017 | Building Security Into Your Workflow with InSpec by Mandi WallsOSDC 2017 | Building Security Into Your Workflow with InSpec by Mandi Walls
OSDC 2017 | Building Security Into Your Workflow with InSpec by Mandi Walls
 
Introduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to ChefIntroduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to Chef
 
Prescriptive System Security with InSpec
Prescriptive System Security with InSpecPrescriptive System Security with InSpec
Prescriptive System Security with InSpec
 
Prescriptive Security with InSpec - All Things Open 2019
Prescriptive Security with InSpec - All Things Open 2019Prescriptive Security with InSpec - All Things Open 2019
Prescriptive Security with InSpec - All Things Open 2019
 

More from Mandi Walls

DOD Raleigh Gamedays with Chaos Engineering.pdf
DOD Raleigh Gamedays with Chaos Engineering.pdfDOD Raleigh Gamedays with Chaos Engineering.pdf
DOD Raleigh Gamedays with Chaos Engineering.pdf
Mandi Walls
 
Addo reducing trauma in organizations with SLOs and chaos engineering
Addo  reducing trauma in organizations with SLOs and chaos engineeringAddo  reducing trauma in organizations with SLOs and chaos engineering
Addo reducing trauma in organizations with SLOs and chaos engineering
Mandi Walls
 
Full Service Ownership
Full Service OwnershipFull Service Ownership
Full Service Ownership
Mandi Walls
 
PagerDuty: Best Practices for On Call Teams
PagerDuty: Best Practices for On Call TeamsPagerDuty: Best Practices for On Call Teams
PagerDuty: Best Practices for On Call Teams
Mandi Walls
 
InSpec at DevOps ATL Meetup January 22, 2020
InSpec at DevOps ATL Meetup January 22, 2020InSpec at DevOps ATL Meetup January 22, 2020
InSpec at DevOps ATL Meetup January 22, 2020
Mandi Walls
 
Using Chef InSpec for Infrastructure Security
Using Chef InSpec for Infrastructure SecurityUsing Chef InSpec for Infrastructure Security
Using Chef InSpec for Infrastructure Security
Mandi Walls
 
Adding Security to Your Workflow With InSpec - SCaLE17x
Adding Security to Your Workflow With InSpec - SCaLE17xAdding Security to Your Workflow With InSpec - SCaLE17x
Adding Security to Your Workflow With InSpec - SCaLE17x
Mandi Walls
 
Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018
Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018
Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018
Mandi Walls
 
BuildStuff.LT 2018 InSpec Workshop
BuildStuff.LT 2018 InSpec WorkshopBuildStuff.LT 2018 InSpec Workshop
BuildStuff.LT 2018 InSpec Workshop
Mandi Walls
 
InSpec Workshop at Velocity London 2018
InSpec Workshop at Velocity London 2018InSpec Workshop at Velocity London 2018
InSpec Workshop at Velocity London 2018
Mandi Walls
 
DevOpsDays InSpec Workshop
DevOpsDays InSpec WorkshopDevOpsDays InSpec Workshop
DevOpsDays InSpec Workshop
Mandi Walls
 
Adding Security and Compliance to Your Workflow with InSpec
Adding Security and Compliance to Your Workflow with InSpecAdding Security and Compliance to Your Workflow with InSpec
Adding Security and Compliance to Your Workflow with InSpec
Mandi Walls
 
InSpec - June 2018 at Open28.be
InSpec - June 2018 at Open28.beInSpec - June 2018 at Open28.be
InSpec - June 2018 at Open28.be
Mandi Walls
 
habitat at docker bud
habitat at docker budhabitat at docker bud
habitat at docker bud
Mandi Walls
 
Ingite Slides for InSpec
Ingite Slides for InSpecIngite Slides for InSpec
Ingite Slides for InSpec
Mandi Walls
 
Habitat at LinuxLab IT
Habitat at LinuxLab ITHabitat at LinuxLab IT
Habitat at LinuxLab IT
Mandi Walls
 
InSpec Workshop DevSecCon 2017
InSpec Workshop DevSecCon 2017InSpec Workshop DevSecCon 2017
InSpec Workshop DevSecCon 2017
Mandi Walls
 
Habitat Workshop at Velocity London 2017
Habitat Workshop at Velocity London 2017Habitat Workshop at Velocity London 2017
Habitat Workshop at Velocity London 2017
Mandi Walls
 
InSpec Workflow for DevOpsDays Riga 2017
InSpec Workflow for DevOpsDays Riga 2017InSpec Workflow for DevOpsDays Riga 2017
InSpec Workflow for DevOpsDays Riga 2017
Mandi Walls
 
Habitat at SRECon
Habitat at SREConHabitat at SRECon
Habitat at SRECon
Mandi Walls
 

More from Mandi Walls (20)

DOD Raleigh Gamedays with Chaos Engineering.pdf
DOD Raleigh Gamedays with Chaos Engineering.pdfDOD Raleigh Gamedays with Chaos Engineering.pdf
DOD Raleigh Gamedays with Chaos Engineering.pdf
 
Addo reducing trauma in organizations with SLOs and chaos engineering
Addo  reducing trauma in organizations with SLOs and chaos engineeringAddo  reducing trauma in organizations with SLOs and chaos engineering
Addo reducing trauma in organizations with SLOs and chaos engineering
 
Full Service Ownership
Full Service OwnershipFull Service Ownership
Full Service Ownership
 
PagerDuty: Best Practices for On Call Teams
PagerDuty: Best Practices for On Call TeamsPagerDuty: Best Practices for On Call Teams
PagerDuty: Best Practices for On Call Teams
 
InSpec at DevOps ATL Meetup January 22, 2020
InSpec at DevOps ATL Meetup January 22, 2020InSpec at DevOps ATL Meetup January 22, 2020
InSpec at DevOps ATL Meetup January 22, 2020
 
Using Chef InSpec for Infrastructure Security
Using Chef InSpec for Infrastructure SecurityUsing Chef InSpec for Infrastructure Security
Using Chef InSpec for Infrastructure Security
 
Adding Security to Your Workflow With InSpec - SCaLE17x
Adding Security to Your Workflow With InSpec - SCaLE17xAdding Security to Your Workflow With InSpec - SCaLE17x
Adding Security to Your Workflow With InSpec - SCaLE17x
 
Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018
Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018
Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018
 
BuildStuff.LT 2018 InSpec Workshop
BuildStuff.LT 2018 InSpec WorkshopBuildStuff.LT 2018 InSpec Workshop
BuildStuff.LT 2018 InSpec Workshop
 
InSpec Workshop at Velocity London 2018
InSpec Workshop at Velocity London 2018InSpec Workshop at Velocity London 2018
InSpec Workshop at Velocity London 2018
 
DevOpsDays InSpec Workshop
DevOpsDays InSpec WorkshopDevOpsDays InSpec Workshop
DevOpsDays InSpec Workshop
 
Adding Security and Compliance to Your Workflow with InSpec
Adding Security and Compliance to Your Workflow with InSpecAdding Security and Compliance to Your Workflow with InSpec
Adding Security and Compliance to Your Workflow with InSpec
 
InSpec - June 2018 at Open28.be
InSpec - June 2018 at Open28.beInSpec - June 2018 at Open28.be
InSpec - June 2018 at Open28.be
 
habitat at docker bud
habitat at docker budhabitat at docker bud
habitat at docker bud
 
Ingite Slides for InSpec
Ingite Slides for InSpecIngite Slides for InSpec
Ingite Slides for InSpec
 
Habitat at LinuxLab IT
Habitat at LinuxLab ITHabitat at LinuxLab IT
Habitat at LinuxLab IT
 
InSpec Workshop DevSecCon 2017
InSpec Workshop DevSecCon 2017InSpec Workshop DevSecCon 2017
InSpec Workshop DevSecCon 2017
 
Habitat Workshop at Velocity London 2017
Habitat Workshop at Velocity London 2017Habitat Workshop at Velocity London 2017
Habitat Workshop at Velocity London 2017
 
InSpec Workflow for DevOpsDays Riga 2017
InSpec Workflow for DevOpsDays Riga 2017InSpec Workflow for DevOpsDays Riga 2017
InSpec Workflow for DevOpsDays Riga 2017
 
Habitat at SRECon
Habitat at SREConHabitat at SRECon
Habitat at SRECon
 

Recently uploaded

DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
ThomasParaiso2
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 

Recently uploaded (20)

DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 

Testable Infrastructure with Chef, Test Kitchen, and Docker

  • 1. 1
  • 2. v1.1.0 Building Testable Infrastructure with Chef, Test Kitchen, and Docker mandi walls mandi@getchef.com CodeMesh.io 5 November 2014 2
  • 3. whoami • Mandi Walls • Professional Services at Chef • @lnxchk 3
  • 4. v1.1.0 What is Chef 4
  • 5. Automation Platform • Creates a dependable view of your entire network’s state. • Can handle complex dependencies among the nodes of your network. • Is fault tolerant. • Is secure. • Can handle multiple platforms • Can manage cloud resources • Provides a foundation for innovation 5
  • 6. 6
  • 7. Infrastructure As Code • Programmatically provision and configure components • Treat like any other code base • Reconstruct business from code repository, data backup, and compute resources 7
  • 8. Policy-Based •You capture the policy for your infrastructure in code •Chef ensures each node in your infrastructure complies with the policy 8
  • 10. Reliable, Repeatable Infrastructure • Everyone on the team gets the same config • Minimize surprises at deploy time • Test app code against real config • Test config with the app code 10
  • 11. Testing Chef • Chef is built on ruby • Test chef code with ruby tools like rspec • Integrate with Test Kitchen, ServerSpec, foodcritic 11
  • 13. Components of Workflow • My workstation - 3 year old mba • git, github repo • chefdk from downloads.getchef.com • Cloud box - CentOS 6.something • docker-io installed from peel • chefdk from downloads.getchef.com • kitchen-docker gem • git 13
  • 14. How I’m Working • Edit recipe code on my machine • my nice editor settings, not much RAM • Run local tests - syntax, style, lint, chef spec • Check into git, upload to repo • git pull on test box • kitchen converge, kitchen verify, kitchen test 14
  • 15. Simple Chef Recipe 15 package "httpd" ! service "httpd" do action :start end ! file "/var/www/html/index.html" do content "<h1>hello world</h1>n" end
  • 16. v1.1.0 What is Test Kitchen 16
  • 17. Test Kitchen • If Chef is code, we should be able to test it 17
  • 18. Test Kitchen •Test harness to execute code on one or more platforms •Driver plugins to allow your code to run on various cloud and virtualization providers •Includes support for many testing frameworks •Included with ChefDK 18
  • 19. .kitchen.yml •The configuration file for your Test Kitchen • driver – virtualization or cloud provider •provisioner – application to configure the node •platforms – target operating systems •suites – target configurations 19
  • 20. .kitchen.yml 20 --- driver: name: docker ! provisioner: name: chef_zero ! platforms: - name: centos-6.4 driver_config: forward: - 80:80 ! suites: - name: default run_list: - recipe[apache::default] attributes:
  • 21. .kitchen.yml • Create a docker container • With centos-6.4 • I’m testing a webapp, so forward port 80 • Provisions our environment with an apache webserver as configured by our team in a Chef recipe 21
  • 22. kitchen create -----> Creating <default-centos-64>...! build context to Docker daemon 2.048 kB! Sending build context to Docker daemon! Step 0 : FROM centos:centos6! Pulling repository centos! ---> 70441cac1ed5! Step 1 : RUN yum clean all! ---> Running in b4ed54c86150! Loaded plugins: fastestmirror! Cleaning repos: base extras updates! Cleaning up Everything! ---> 1c333241ae96! Removing intermediate container b4ed54c86150! Step 2 : RUN yum install -y sudo openssh-server openssh-clients which curl 22
  • 23. docker ps [chef@CentOS63 codemesh]$ sudo docker ps! CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES! 9ddd3300de51 87f714782104 "/usr/sbin/sshd -D - 2 minutes ago Up 2 minutes 0.0.0.0:80->80/tcp, 0.0.0.0:49157->22/tcp stoic_euclid 23
  • 24. kitchen converge - install version 2.2.15-39.el6.centos of package httpd! ! * service[httpd] action start [2014-11-05T00:18:29+00:00] INFO: Processing service[httpd] action start (codemesh::default line 16)! [2014-11-05T00:18:29+00:00] INFO: service[httpd] started! ! - start service service[httpd]! ! * service[httpd] action enable [2014-11-05T00:18:29+00:00] INFO: Processing service[httpd] action enable (codemesh::default line 16)! [2014-11-05T00:18:29+00:00] INFO: service[httpd] enabled! ! - enable service service[httpd]! ! * file[/var/www/html/index.html] action create [2014-11-05T00:18:29+00:00] INFO: Processing file[/var/www/html/index.html] action create (codemesh::default line 20)! [2014-11-05T00:18:29+00:00] INFO: file[/var/www/html/index.html] created file /var/www/ html/index.html! 24
  • 25. kitchen list [chef@CentOS63 codemesh]$ kitchen list! Instance Driver Provisioner Last Action! default-centos-64 Docker ChefZero Converged! 25
  • 26. show me [chef@CentOS63 codemesh]$ curl localhost! <h1>hello world</h1>! [chef@CentOS63 codemesh]$ 26
  • 27. Other Plugins • kitchen-vagrant (included!)! • kitchen-docker! • kitchen-ec2! • kitchen-rackspace! • kitchen-gce! • kitchen-digitalocean! • kitchen-openstack! • kitchen-bluebox! • kitchen-joyent! • kitchen-lxc 27
  • 28. Reliable Configuration • Provision onto platforms that match production • Write Chef recipes once for everyone • Local development work • Testing systems • Production • Customize environments as necessary • ports, user accounts, backend services 28
  • 29. v1.1.0 TDI: Test-Driven Infrastructure 29
  • 30. Testing Bits for Chef • Pre-testing (no running host) • rubocop: ruby style and syntax • ChefSpec: chef-specific unit testing • foodcritic: chef-specific logic and style rules • Post-testing (on a running host) • ServerSpec: integration testing on services • bats: unix system testing 30
  • 31. rubocop $ rubocop recipes/default.rb ! Inspecting 1 file! C! Offenses:! recipes/default.rb:17:11: C: Space inside square brackets detected.! action [ :start, :enable ]! ^! recipes/default.rb:17:27: C: Space inside square brackets detected.! action [ :start, :enable ]! ^! recipes/default.rb:20:6: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.! file "/var/www/html/index.html" do! ^^^^^^^^^^^^^^^^^^^^^^^^^^! 1 file inspected, 3 offenses detected 31
  • 32. fix $ rubocop recipes/default.rb ! Inspecting 1 file! .! ! 1 file inspected, no offenses detected 32
  • 33. ChefSpec • Test the intention of your code • Built on rspec • Specific to Chef 33
  • 34. Methods • You can TDD infrastructure code • Keep on top of regressions • Give safe configurations to the whole team 34
  • 35. chefspec file require 'chefspec'! ! describe 'codemesh::default' do! let(:chef_run) do! ChefSpec::Runner.new.converge(described_recipe)! end ! ! it 'installs apache' do! expect(chef_run).to install_package('httpd')! end ! end! 35
  • 36. Run chefspec $ rspec spec/unit/default.rb ! .! ! Finished in 0.00735 seconds (files took 1.85 seconds to load)! 1 example, 0 failures! 36
  • 37. ServerSpec • Tests running systems • Run from Test Kitchen at the end of kitchen converge • Not dependent on Chef! • Use from other config tools • Use standalone! • serverspec.org 37
  • 38. Serverspec File require 'serverspec'! ! set :backend, :exec! ! describe 'apache' do! it "is installed" do! expect(package 'httpd').to be_installed! end ! it "is running" do! expect(service 'httpd').to be_running! end ! it "is listening on port 80" do! expect(port 80).to be_listening! end ! 38 it "displays a custom home page" do! expect(command("curl localhost").stdout).to match / hello/! end ! end!
  • 39. kitchen verify apache! is installed! is running! is listening on port 80! displays a custom home page! ! Finished in 1.45 seconds (files took 0.6278 seconds to load)! 4 examples, 0 failures! Finished verifying <default-centos-64> (0m18.23s).! -----> Kitchen is finished. (0m39.50s)! 39
  • 40. test vs verify • kitchen verify will run tests on an instance that is already running • kitchen test will start a new instance, run all the chef recipes, run all the tests, and then destroy the instance • nice for different workflow - user watching a test vs a build server watching for a good return code • fast with Docker! 40
  • 42. Container Ecosystem • Chef container resources help you manage container workflow • Create and deploy images • https://docs.getchef.com/containers.html 42
  • 43. Testing Tools • ChefSpec: https://docs.getchef.com/chefspec.html • Serverspec: http://serverspec.org/ • bats: https://github.com/sstephenson/bats • Foodcritic: • More on ChefDK: • http://foodfightshow.org/2014/08/chefdk.html • More on this workflow: • http://www.slideshare.net/misheska/testing-yourautomationcode- docker-version-v02 43
  • 44. Some URLs • http://getchef.com • http://docs.getchef.com • http://supermarket.getchef.com • http://youtube.com/getchef • http://lists.opscode.com • irc.freenode.net: #chef, #chef-hacking • Twitter: @chef #getchef, @learnchef #learnchef •Meetups in your city?!? 44
  • 46. 46