test kitchen and infrastructure as code
DESCRIPTION
A presentation for the Automation session at the 2014 Cyber Summit by Fletcher Nichol, an Engineer with Heavy Water Operations.TRANSCRIPT
![Page 1: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/1.jpg)
Test Kitchen and
Infrastructure as CodeCyber Summit 2014 September 25, 2014
Fletcher Nichol @fnichol
![Page 3: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/3.jpg)
1. Infrastructure as Code 2. Test Kitchen
Agenda
![Page 4: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/4.jpg)
I am a software developer
Preface
![Page 5: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/5.jpg)
What isInfrastructure?
![Page 6: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/6.jpg)
Physical and virtual resources: compute (servers, vms), networking, storage, etc.
Infrastructure
![Page 7: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/7.jpg)
What isInfrastructure Automation?
![Page 8: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/8.jpg)
Code
![Page 9: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/9.jpg)
Software
![Page 10: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/10.jpg)
What isInfrastructure
As Code?
![Page 11: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/11.jpg)
“Enable the reconstruction of the business from nothing but a source code repository, an application data backup, and bare metal resources”
Infrastructure as Code
- Adam Jacob, Web Operations
![Page 12: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/12.jpg)
![Page 13: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/13.jpg)
![Page 14: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/14.jpg)
If we can model infrastructure as code
![Page 15: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/15.jpg)
If we can model infrastructure as code
can we apply code process and practices?
![Page 16: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/16.jpg)
In other words…
![Page 17: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/17.jpg)
Can we apply
![Page 18: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/18.jpg)
Can we applySoftware Engineering
to infrastrcuture?
![Page 19: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/19.jpg)
Yep.
![Page 20: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/20.jpg)
What processes and practices apply to software?
![Page 21: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/21.jpg)
Testing
![Page 22: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/22.jpg)
Test Kitchen“Your infrastructure deserves tests too”
![Page 23: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/23.jpg)
![Page 24: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/24.jpg)
An infrastructure testing tool
Test Kitchen
![Page 25: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/25.jpg)
Used in development
Test Kitchen
![Page 26: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/26.jpg)
Used in CI/CD pipeline
Test Kitchen
![Page 27: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/27.jpg)
Describes your testing setup on a single server
Test Kitchen
![Page 28: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/28.jpg)
.kitchen.yml
Test Kitchen Code
![Page 29: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/29.jpg)
--- driver: name: vagrant !
provisioner: name: chef_solo !
platforms: - name: ubuntu-14.04 - name: centos-6.5 !
suites: - name: client run_list: - recipe[postgresql::client] - name: server run_list: - recipe[postgresql::server]
Code
![Page 30: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/30.jpg)
--- driver: name: vagrant !
provisioner: name: chef_solo !
platforms: - name: ubuntu-14.04 - name: centos-6.5 !
suites: - name: client run_list: - recipe[postgresql::client] - name: server run_list: - recipe[postgresql::server]
Code
![Page 31: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/31.jpg)
--- driver: name: vagrant !
provisioner: name: chef_solo !
platforms: - name: ubuntu-14.04 - name: centos-6.5 !
suites: - name: client run_list: - recipe[postgresql::client] - name: server run_list: - recipe[postgresql::server]
Code
![Page 32: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/32.jpg)
--- driver: name: vagrant !
provisioner: name: chef_solo !
platforms: - name: ubuntu-14.04 - name: centos-6.5 !
suites: - name: client run_list: - recipe[postgresql::client] - name: server run_list: - recipe[postgresql::server]
Code
![Page 33: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/33.jpg)
--- driver: name: vagrant !
provisioner: name: chef_solo !
platforms: - name: ubuntu-14.04 - name: centos-6.5 !
suites: - name: client run_list: - recipe[postgresql::client] - name: server run_list: - recipe[postgresql::server]
Code
![Page 34: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/34.jpg)
Runs multiple testing setups in isolation
Test Kitchen
![Page 35: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/35.jpg)
Plugin system to support automation tools, cloud providers,
& testing frameworks
Test Kitchen
![Page 36: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/36.jpg)
Amazon EC2, Rackspace, Digital Ocean, OpenStack, LXC, Vagrant, CloudStack,
Joyent, VMware vSphere, Google Compute Engine, Microsoft Azure, Docker, etc.
Test KitchenDrivers
![Page 37: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/37.jpg)
Chef (Solo, Client), Simple Shell, Puppet (Apply), Salt, Ansible, etc.
Test KitchenProvisioners
![Page 38: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/38.jpg)
Simple bash, bats, MiniTest, shUnit2, Aruba, Serverspec,
RSpec, shpec, Cucumber, etc.
Test KitchenTesting Frameworks
![Page 39: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/39.jpg)
http://kitchen.ci/docs/getting-started/
Test KitchenGetting Started
![Page 40: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/40.jpg)
“In short, software is eating the world.”
It’s All Software
- Marc Andreessen, 2011
![Page 41: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/41.jpg)
Infrastructure Automation is
Real
![Page 42: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/42.jpg)
Infrastructure Automation is
Real Hard™
![Page 43: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/43.jpg)
Infrastructure Automation is
Real …but
![Page 44: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/44.jpg)
Infrastructure Automation is
Real Possible™
![Page 45: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/45.jpg)
Thanks!Cyber Summit 2014 September 25, 2014
Fletcher Nichol @fnichol
![Page 46: Test Kitchen and Infrastructure as Code](https://reader034.vdocument.in/reader034/viewer/2022052506/557570b8d8b42a2e248b5125/html5/thumbnails/46.jpg)
Photo Creditshttps://flic.kr/p/fD2CXV https://flic.kr/p/i3NECz https://flic.kr/p/9urXjF