SlideShare a Scribd company logo
Testing Ansible Infrastructure
with Serverspec
Docker, Serverspec, Ansible, Travis-ci and Test Kitchen.
Ben Visser
Why do we care
about infra
testing?
we have ~50 ansible roles
The 3 Tools
Test Kitchen
This is what we use to spin
up a consistent virtual
environment to run our tests
on.
Serverspec
This is like rspec for
servers. We use it to test
that our infrastructure
does what we want it to.
describe file('/etc/passwd') do
it { should be_file }
end
Travis-ci
This is a hosted CI tool
that we use to spin up a
virtual env with test
kitchen and run tests
with serverspec.
Test Kitchen Components
1.Drivers
Test Kitchen
Drivers allow you to run your tests on cloud
providers or locally with virtualization.
e.g docker, vagrant, azure, aws, and more.
2. Platforms
Test Kitchen
Platform is the operating system you are
running your tests on.
e.g mint, ubuntu, windows
3.Provisioners
Test Kitchen
A provisioner is the configuration
management tool used to provision the
environment.
e.g ansible, salt, chef, puppet
4. Test Suites
Test Kitchen
A test suite is the tests you would like to verify
against the environment.
eg. Bats, Cucumber, Rspec, Serverspec
Our Testing Experiences
First try... we only useed .travis.yml
.travis.yml
Second try...
.travis.yml
Second try...
.kitchen.yml
Second try...
serverspec tests
https://github.com/telusdigital/ansible-nginx
Example repo
TELUS digital » Development

More Related Content

PPTX
Verifying your Ansible Roles using Docker, Test Kitchen and Serverspec
PPTX
OSDC2014: Testing Server Infrastructure with #serverspec
PPTX
Docker ansible-make-chef-puppet-unnecessary-minnihan
PPTX
Monitor-Driven Development Using Ansible
PDF
Investigation of testing with ansible
PDF
Test Driven Infrastructure with Docker, Test Kitchen and Serverspec
PPTX
Test-Driven Infrastructure with Ansible, Test Kitchen, Serverspec and RSpec
PDF
Continuous infrastructure testing
Verifying your Ansible Roles using Docker, Test Kitchen and Serverspec
OSDC2014: Testing Server Infrastructure with #serverspec
Docker ansible-make-chef-puppet-unnecessary-minnihan
Monitor-Driven Development Using Ansible
Investigation of testing with ansible
Test Driven Infrastructure with Docker, Test Kitchen and Serverspec
Test-Driven Infrastructure with Ansible, Test Kitchen, Serverspec and RSpec
Continuous infrastructure testing

What's hot (20)

PPTX
Test-Driven Infrastructure with Puppet, Test Kitchen, Serverspec and RSpec
PPTX
Monitoring and tuning your chef server - chef conf talk
PPTX
Go Faster with Ansible (PHP meetup)
PPTX
Ansible module development 101
PDF
DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'
PPTX
Ansible presentation
PDF
Testing Ansible with Jenkins and Docker
PDF
Portland PUG April 2014: Beaker 101: Acceptance Test Everything
PPTX
How to Write Chef Cookbook
PDF
How Ansible Makes Automation Easy
PPTX
What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...
PDF
Testing with Ansible
PDF
Getting started with Ansible
PPT
Fake IT, until you make IT
PPTX
Serverspec and Sensu - Testing and Monitoring collide
PDF
Ansible Introduction
PPTX
Go Faster with Ansible (AWS meetup)
PPTX
Infrastructure Automation with Chef & Ansible
PDF
CI/CD Using Ansible and Jenkins for Infrastructure
PPTX
Automated Deployments with Ansible
Test-Driven Infrastructure with Puppet, Test Kitchen, Serverspec and RSpec
Monitoring and tuning your chef server - chef conf talk
Go Faster with Ansible (PHP meetup)
Ansible module development 101
DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'
Ansible presentation
Testing Ansible with Jenkins and Docker
Portland PUG April 2014: Beaker 101: Acceptance Test Everything
How to Write Chef Cookbook
How Ansible Makes Automation Easy
What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...
Testing with Ansible
Getting started with Ansible
Fake IT, until you make IT
Serverspec and Sensu - Testing and Monitoring collide
Ansible Introduction
Go Faster with Ansible (AWS meetup)
Infrastructure Automation with Chef & Ansible
CI/CD Using Ansible and Jenkins for Infrastructure
Automated Deployments with Ansible
Ad

Viewers also liked (20)

DOC
CVTemplate_en_GB europass zugravu
PPTX
Phonics
DOCX
Metodos computarizados para resolver ecuaciones diferenciales
PPTX
Doctrina
PPTX
Mobile Banking Student Presentation
PDF
PAUG 03/05/2016 : Rechercher et analyser les fuites mémoires dans une applica...
PDF
ResumeE1
PDF
Deep Dive Training Energy Efficiency in Industrial Processes
PDF
Aplikasi Gallery Pengetahuan
PDF
Renaissance Quarterly Review of Brusanus
PDF
Statistical Analysis of Interrelationship between Money Supply Exchange Rates...
PDF
Illegal Trade of endangered species
PDF
Financial Sector Performance and Conceptual Framework
DOCX
González valentin annex_competic2
PDF
González valentín catàleg_competic2
PDF
WindEnergyFinal-2-2
PDF
Praktek
PPTX
Latihan
PDF
Buyer'sGuideIssuu
PDF
My Invoice Finance
CVTemplate_en_GB europass zugravu
Phonics
Metodos computarizados para resolver ecuaciones diferenciales
Doctrina
Mobile Banking Student Presentation
PAUG 03/05/2016 : Rechercher et analyser les fuites mémoires dans une applica...
ResumeE1
Deep Dive Training Energy Efficiency in Industrial Processes
Aplikasi Gallery Pengetahuan
Renaissance Quarterly Review of Brusanus
Statistical Analysis of Interrelationship between Money Supply Exchange Rates...
Illegal Trade of endangered species
Financial Sector Performance and Conceptual Framework
González valentin annex_competic2
González valentín catàleg_competic2
WindEnergyFinal-2-2
Praktek
Latihan
Buyer'sGuideIssuu
My Invoice Finance
Ad

Similar to Testing Ansible Infrastructure With Serverspec (20)

PDF
Ansible, integration testing, and you.
PDF
Atmosphere 2018: Yury Tsarev - TEST DRIVEN INFRASTRUCTURE FOR HIGHLY PERFORMI...
PPTX
Infrastructure testing with Molecule and TestInfra
PDF
Test Kitchen and Infrastructure as Code
PPTX
Effective Testing with Ansible and InSpec
PPTX
Introduction to Test Kitchen and InSpec
PDF
OSDC 2014: Andreas Schmidt - Testing server infrastructure with serverspec
PDF
Test-Driven Infrastructure with Chef
PPTX
Introduction to Test Kitchen
PDF
Head in the Clouds: Testing Infra as Code - Config Management 2020
PDF
A developers' journey into building automated tests for IT from the ground up
PDF
OSCamp 2019 | #3 Ansible: Automated Tests of Ansible code with GitLab, Vagran...
PDF
Chef for beginners module 5
PDF
Testable Infrastructure with Chef, Test Kitchen, and Docker
PPTX
Test Driven Infrastructure with Serverspec and KitchenCI
PDF
Infrastructure = Code
PDF
End to End immutable infrastructure testing
PDF
Zero to Test Driven Infrastructure
PDF
CI for Chefs
PPTX
CLUG 2014-10 - Cookbook CI with Jenkins
Ansible, integration testing, and you.
Atmosphere 2018: Yury Tsarev - TEST DRIVEN INFRASTRUCTURE FOR HIGHLY PERFORMI...
Infrastructure testing with Molecule and TestInfra
Test Kitchen and Infrastructure as Code
Effective Testing with Ansible and InSpec
Introduction to Test Kitchen and InSpec
OSDC 2014: Andreas Schmidt - Testing server infrastructure with serverspec
Test-Driven Infrastructure with Chef
Introduction to Test Kitchen
Head in the Clouds: Testing Infra as Code - Config Management 2020
A developers' journey into building automated tests for IT from the ground up
OSCamp 2019 | #3 Ansible: Automated Tests of Ansible code with GitLab, Vagran...
Chef for beginners module 5
Testable Infrastructure with Chef, Test Kitchen, and Docker
Test Driven Infrastructure with Serverspec and KitchenCI
Infrastructure = Code
End to End immutable infrastructure testing
Zero to Test Driven Infrastructure
CI for Chefs
CLUG 2014-10 - Cookbook CI with Jenkins

Testing Ansible Infrastructure With Serverspec

Editor's Notes

  • #11: really messy testing hard to test with only bash no testing framework used most commonly used for ansible roles