SlideShare una empresa de Scribd logo
1 de 31
Descargar para leer sin conexión
Testing your infrastructure
with litmus
04/02/2020 cfgmgmtcamp 2020
Bram Vogelaar
@attachmentgenie
~$ whoami
●
I used to be a Molecular Biologist,
●
Then became a Dev,
●
Now an Ops.
●
Open Source Consultant @inuits.eu
“The intern just “solved” the problem
with $product by “fixing” the SSH
config”
Wait what?
$problems++?
https://preshing.com/20110926/high-resolution-mandelbrot-in-obfuscated-python/
Testing Pyramid
Read out loud warning
“Unit testing is a software development
process in which the smallest testable parts
of an application, called units, are individually
and independently scrutinized for proper
operation”
rspec-puppet
●
Independantly developed
●
Ruby based
●
Rspec based
●
(mostly) quick to run
●
(almost) unit testing *
https://rspec-puppet.com/
Rspec test
require 'spec_helper'
describe 'ssh::server', type: :class do
on_supported_os.each do |os, facts|
context "on #{os}" do
let(:facts) { facts }
context 'with defaults for all parameters' do
it { is_expected.to contain_class('ssh::server') }
it { is_expected.to contain_class('ssh::params') }
it do
is_expected.to contain_package('openssh-server').with(
'ensure' => 'present',
)
end
Read out loud warning
“An acceptance test is a formal description of
the behavior of a software product, generally
expressed as an example or a usage
scenario”
Beaker
●
Developed by puppet(labs)
●
Ruby based
●
Native puppet support
●
Docker & Vagrant providers *
●
Serverspec
https://github.com/puppetlabs/beaker
Serverspec
describe package('openssh-server')
it { should be_installed }
end
https://serverspec.org/
Test Kitchen
●
Based on the chef toolchain
●
Puppet support via plugin
●
Multiple provider support
●
Inspec (and serverspec) support
https://github.com/neillturner/kitchen-puppet
inspec
control 'ports-1.0' do
impact 1.0
title 'Port 9000 should have a fpm pool listening'
describe port(9000) do
it { should be_listening }
its('processes') {should include 'php-fpm'}
end
end
https://www.inspec.io/
Inspec (audit) profiles
include_controls 'linux-baseline'
https://dev-sec.io/
Highly Opinionated Awkward Bits
●
Designed for single node testing only *
●
Rage inducing CLI (beaker)
●
Weird CLI verbs (kitchen)
●
No orchestration (kitchen)
●
License issues (inspec)
Litmus
●
Developed by puppet
●
Ruby based
●
Native puppet support
●
Docker & Vagrant providers
●
Server-spec
●
Build on puppet’s Bolt
●
Multi node support
https://github.com/puppetlabs/puppet_litmus
provision.yaml
---
docker:
provisioner: docker
images: ['waffleimage/centos7']
vagrant:
provisioner: vagrant
images: ['centos/7']
bootstrap
# Start a docker image
>bundle exec rake 'litmus:provision[docker, centos:7]'
# Start all nodes defined it the vagrant list
>bundle exec rake 'litmus:provision[vagrant]'
Provisioning centos_7-2222
{"status":"ok","node_name":"localhost"}
Inventory.yml
> cat inventory.yaml
---
groups:
- name: ssh_nodes
nodes:
- name: localhost:2222
config:
transport: ssh
ssh:
user: root
password: root
port: 2222
host-key-check: false
facts:
provisioner: docker
container_name: centos_7-2222
Batteries not included?
# Installs the latest Puppet Agent on all targets
> bundle exec rake "litmus:install_agent"
# Installs Puppet 5 on all targets
> bundle exec rake 'litmus:install_agent[puppet5]'
# Install the latest Puppet Agent on a specific target
> bundle exec rake 'litmus:install_agent[foo.bar.bbq]'
Bolt
> bolt command run 'puppet --version' -n localhost:2222 -i inventory.yaml
Started on localhost...
Finished on localhost:
STDOUT:
6.12.0
Successful on 1 node: localhost:2222
Ran on 1 node in 0.92 seconds
Multi-node Setup
> bundle exec bolt --modulepath $(pwd)/spec/fixtures/modules/
plan run provision::server_setup --inventoryfile inventory.yaml
> bundle exec bolt --modulepath $(pwd)/spec/fixtures/modules/
plan run provision::agents --inventoryfile inventory.yaml
Push your code
> bundle exec rake litmus:install_module
Fire in the hole!
> bundle exec rake litmus:acceptance:parallel
Running against 1 machines |Time: 00:00:48 |
==================================================================
====================== | Time: 00:00:48
......
Finished in 46.38 seconds (files took 1.97 seconds to load)
6 examples, 0 failures
Fire in the hole!
> bundle exec rake litmus:acceptance:parallel
Running against 1 machines |Time: 00:00:48 |
==================================================================
====================== | Time: 00:00:48
......
Finished in 46.38 seconds (files took 1.97 seconds to load)
6 examples, 0 failures
Granularity
> TARGET_HOST=foo.bar.bbq bundle exec
rspec ./spec/acceptance
> bundle exec rspec
./spec/acceptance/test_spec.rb:21
Release Resources
> bundle exec rake litmus:tear_down
{"node"=>"localhost", "status"=>"success",
"result"=>{"_output"=>"Removed localhost:2222
n{"status":"ok"}n"}}
.travis.yml
before_script: ["bundle exec rake 'litmus:provision_list[travis_deb]'", "bundle exec rake
'litmus:install_agent[puppet6]'", "bundle exec rake litmus:install_module"]
bundler_args:
dist: trusty
env: PLATFORMS=deb_puppet6
rvm: 2.5.1
script: ["bundle exec rake litmus:acceptance:parallel"]
services: docker
stage: acceptance
sudo: required
INUITS bvba
Essensteenweg 31
2930 Brasschaat
Belgium
BE 0891.514.231
Contact:
+32.380.821.05
info@inuits.eu
inuits.eu
bram@inuits.eu
@attachmentgenie

Más contenido relacionado

La actualidad más candente

Creating Reusable Puppet Profiles
Creating Reusable Puppet ProfilesCreating Reusable Puppet Profiles
Creating Reusable Puppet ProfilesBram Vogelaar
 
Bootstrap your Cloud Infrastructure using puppet and hashicorp stack
Bootstrap your Cloud Infrastructure using puppet and hashicorp stackBootstrap your Cloud Infrastructure using puppet and hashicorp stack
Bootstrap your Cloud Infrastructure using puppet and hashicorp stackBram Vogelaar
 
Puppet and the HashiCorp Suite
Puppet and the HashiCorp SuitePuppet and the HashiCorp Suite
Puppet and the HashiCorp SuiteBram Vogelaar
 
Static Typing in Vault
Static Typing in VaultStatic Typing in Vault
Static Typing in VaultGlynnForrest
 
Lua tech talk
Lua tech talkLua tech talk
Lua tech talkLocaweb
 
Ansible 實戰:top down 觀點
Ansible 實戰:top down 觀點Ansible 實戰:top down 觀點
Ansible 實戰:top down 觀點William Yeh
 
Ansible roles done right
Ansible roles done rightAnsible roles done right
Ansible roles done rightDan Vaida
 
Ansible for beginners ...?
Ansible for beginners ...?Ansible for beginners ...?
Ansible for beginners ...?shirou wakayama
 
Automation with Ansible and Containers
Automation with Ansible and ContainersAutomation with Ansible and Containers
Automation with Ansible and ContainersRodolfo Carvalho
 
Ansible not only for Dummies
Ansible not only for DummiesAnsible not only for Dummies
Ansible not only for DummiesŁukasz Proszek
 
Learn basic ansible using docker
Learn basic ansible using dockerLearn basic ansible using docker
Learn basic ansible using dockerLarry Cai
 
Hopping in clouds: a tale of migration from one cloud provider to another
Hopping in clouds: a tale of migration from one cloud provider to anotherHopping in clouds: a tale of migration from one cloud provider to another
Hopping in clouds: a tale of migration from one cloud provider to anotherMichele Orselli
 
Running trusted payloads with Nomad and Waypoint
Running trusted payloads with Nomad and WaypointRunning trusted payloads with Nomad and Waypoint
Running trusted payloads with Nomad and WaypointBram Vogelaar
 
Using Node.js to Build Great Streaming Services - HTML5 Dev Conf
Using Node.js to  Build Great  Streaming Services - HTML5 Dev ConfUsing Node.js to  Build Great  Streaming Services - HTML5 Dev Conf
Using Node.js to Build Great Streaming Services - HTML5 Dev ConfTom Croucher
 
Docker remote-api
Docker remote-apiDocker remote-api
Docker remote-apiEric Ahn
 
An intro to Docker, Terraform, and Amazon ECS
An intro to Docker, Terraform, and Amazon ECSAn intro to Docker, Terraform, and Amazon ECS
An intro to Docker, Terraform, and Amazon ECSYevgeniy Brikman
 
Take control of your Jenkins jobs via job DSL.
Take control of your Jenkins jobs via job DSL.Take control of your Jenkins jobs via job DSL.
Take control of your Jenkins jobs via job DSL.Łukasz Proszek
 
Introduction to ansible
Introduction to ansibleIntroduction to ansible
Introduction to ansibleOmid Vahdaty
 

La actualidad más candente (20)

Creating Reusable Puppet Profiles
Creating Reusable Puppet ProfilesCreating Reusable Puppet Profiles
Creating Reusable Puppet Profiles
 
Bootstrap your Cloud Infrastructure using puppet and hashicorp stack
Bootstrap your Cloud Infrastructure using puppet and hashicorp stackBootstrap your Cloud Infrastructure using puppet and hashicorp stack
Bootstrap your Cloud Infrastructure using puppet and hashicorp stack
 
Puppet and the HashiCorp Suite
Puppet and the HashiCorp SuitePuppet and the HashiCorp Suite
Puppet and the HashiCorp Suite
 
Static Typing in Vault
Static Typing in VaultStatic Typing in Vault
Static Typing in Vault
 
Lua tech talk
Lua tech talkLua tech talk
Lua tech talk
 
Ansible 實戰:top down 觀點
Ansible 實戰:top down 觀點Ansible 實戰:top down 觀點
Ansible 實戰:top down 觀點
 
Ansible roles done right
Ansible roles done rightAnsible roles done right
Ansible roles done right
 
Ansible for beginners ...?
Ansible for beginners ...?Ansible for beginners ...?
Ansible for beginners ...?
 
Automation with Ansible and Containers
Automation with Ansible and ContainersAutomation with Ansible and Containers
Automation with Ansible and Containers
 
Ansible not only for Dummies
Ansible not only for DummiesAnsible not only for Dummies
Ansible not only for Dummies
 
Learn basic ansible using docker
Learn basic ansible using dockerLearn basic ansible using docker
Learn basic ansible using docker
 
Hopping in clouds: a tale of migration from one cloud provider to another
Hopping in clouds: a tale of migration from one cloud provider to anotherHopping in clouds: a tale of migration from one cloud provider to another
Hopping in clouds: a tale of migration from one cloud provider to another
 
Running trusted payloads with Nomad and Waypoint
Running trusted payloads with Nomad and WaypointRunning trusted payloads with Nomad and Waypoint
Running trusted payloads with Nomad and Waypoint
 
Using Node.js to Build Great Streaming Services - HTML5 Dev Conf
Using Node.js to  Build Great  Streaming Services - HTML5 Dev ConfUsing Node.js to  Build Great  Streaming Services - HTML5 Dev Conf
Using Node.js to Build Great Streaming Services - HTML5 Dev Conf
 
Nginx-lua
Nginx-luaNginx-lua
Nginx-lua
 
Refactoring terraform
Refactoring terraformRefactoring terraform
Refactoring terraform
 
Docker remote-api
Docker remote-apiDocker remote-api
Docker remote-api
 
An intro to Docker, Terraform, and Amazon ECS
An intro to Docker, Terraform, and Amazon ECSAn intro to Docker, Terraform, and Amazon ECS
An intro to Docker, Terraform, and Amazon ECS
 
Take control of your Jenkins jobs via job DSL.
Take control of your Jenkins jobs via job DSL.Take control of your Jenkins jobs via job DSL.
Take control of your Jenkins jobs via job DSL.
 
Introduction to ansible
Introduction to ansibleIntroduction to ansible
Introduction to ansible
 

Similar a Testing your infrastructure with litmus

Infrastructure as code - Python Saati #36
Infrastructure as code - Python Saati #36Infrastructure as code - Python Saati #36
Infrastructure as code - Python Saati #36Halil Kaya
 
How I hack on puppet modules
How I hack on puppet modulesHow I hack on puppet modules
How I hack on puppet modulesKris Buytaert
 
Capistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient wayCapistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient waySylvain Rayé
 
#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to AnsibleCédric Delgehier
 
Automating Docker Containers with Puppet 2014 10-13
Automating Docker Containers with Puppet 2014 10-13Automating Docker Containers with Puppet 2014 10-13
Automating Docker Containers with Puppet 2014 10-13kylog
 
k8s practice 2023.pptx
k8s practice 2023.pptxk8s practice 2023.pptx
k8s practice 2023.pptxwonyong hwang
 
Continous Delivering a PHP application
Continous Delivering a PHP applicationContinous Delivering a PHP application
Continous Delivering a PHP applicationJavier López
 
One commit, one release. Continuously delivering a Symfony project.
One commit, one release. Continuously delivering a Symfony project.One commit, one release. Continuously delivering a Symfony project.
One commit, one release. Continuously delivering a Symfony project.Javier López
 
Node.js basics
Node.js basicsNode.js basics
Node.js basicsBen Lin
 
PuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of PuppetPuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of PuppetWalter Heck
 
PuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of PuppetPuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of PuppetOlinData
 
Installaling Puppet Master and Agent
Installaling Puppet Master and AgentInstallaling Puppet Master and Agent
Installaling Puppet Master and AgentRanjit Avasarala
 
Embedded Recipes 2019 - Testing firmware the devops way
Embedded Recipes 2019 - Testing firmware the devops wayEmbedded Recipes 2019 - Testing firmware the devops way
Embedded Recipes 2019 - Testing firmware the devops wayAnne Nicolas
 
Gr8conf EU 2018 - Bring you infrastructure under control with Infrastructor
Gr8conf EU 2018 - Bring you infrastructure under control with InfrastructorGr8conf EU 2018 - Bring you infrastructure under control with Infrastructor
Gr8conf EU 2018 - Bring you infrastructure under control with InfrastructorStanislav Tiurikov
 
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)Puppet
 
MeaNstack on Docker
MeaNstack on DockerMeaNstack on Docker
MeaNstack on DockerDaniel Ku
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction Robert Reiz
 
Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierCarlos Sanchez
 
Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Cosimo Streppone
 

Similar a Testing your infrastructure with litmus (20)

Infrastructure as code - Python Saati #36
Infrastructure as code - Python Saati #36Infrastructure as code - Python Saati #36
Infrastructure as code - Python Saati #36
 
How I hack on puppet modules
How I hack on puppet modulesHow I hack on puppet modules
How I hack on puppet modules
 
Docker meetup
Docker meetupDocker meetup
Docker meetup
 
Capistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient wayCapistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient way
 
#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible
 
Automating Docker Containers with Puppet 2014 10-13
Automating Docker Containers with Puppet 2014 10-13Automating Docker Containers with Puppet 2014 10-13
Automating Docker Containers with Puppet 2014 10-13
 
k8s practice 2023.pptx
k8s practice 2023.pptxk8s practice 2023.pptx
k8s practice 2023.pptx
 
Continous Delivering a PHP application
Continous Delivering a PHP applicationContinous Delivering a PHP application
Continous Delivering a PHP application
 
One commit, one release. Continuously delivering a Symfony project.
One commit, one release. Continuously delivering a Symfony project.One commit, one release. Continuously delivering a Symfony project.
One commit, one release. Continuously delivering a Symfony project.
 
Node.js basics
Node.js basicsNode.js basics
Node.js basics
 
PuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of PuppetPuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of Puppet
 
PuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of PuppetPuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of Puppet
 
Installaling Puppet Master and Agent
Installaling Puppet Master and AgentInstallaling Puppet Master and Agent
Installaling Puppet Master and Agent
 
Embedded Recipes 2019 - Testing firmware the devops way
Embedded Recipes 2019 - Testing firmware the devops wayEmbedded Recipes 2019 - Testing firmware the devops way
Embedded Recipes 2019 - Testing firmware the devops way
 
Gr8conf EU 2018 - Bring you infrastructure under control with Infrastructor
Gr8conf EU 2018 - Bring you infrastructure under control with InfrastructorGr8conf EU 2018 - Bring you infrastructure under control with Infrastructor
Gr8conf EU 2018 - Bring you infrastructure under control with Infrastructor
 
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)
 
MeaNstack on Docker
MeaNstack on DockerMeaNstack on Docker
MeaNstack on Docker
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction
 
Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next Frontier
 
Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013
 

Más de Bram Vogelaar

Cost reconciliation in a post CMDB world
Cost reconciliation in a post CMDB worldCost reconciliation in a post CMDB world
Cost reconciliation in a post CMDB worldBram Vogelaar
 
Self scaling Multi cloud nomad workloads
Self scaling Multi cloud nomad workloadsSelf scaling Multi cloud nomad workloads
Self scaling Multi cloud nomad workloadsBram Vogelaar
 
Scraping metrics for fun and profit
Scraping metrics for fun and profitScraping metrics for fun and profit
Scraping metrics for fun and profitBram Vogelaar
 
10 things i learned building nomad-packs
10 things i learned building nomad-packs10 things i learned building nomad-packs
10 things i learned building nomad-packsBram Vogelaar
 
10 things I learned building Nomad packs
10 things I learned building Nomad packs10 things I learned building Nomad packs
10 things I learned building Nomad packsBram Vogelaar
 
Easy Cloud Native Transformation with Nomad
Easy Cloud Native Transformation with NomadEasy Cloud Native Transformation with Nomad
Easy Cloud Native Transformation with NomadBram Vogelaar
 
Observability; a gentle introduction
Observability; a gentle introductionObservability; a gentle introduction
Observability; a gentle introductionBram Vogelaar
 
Running Trusted Payload with Nomad and Waypoint
Running Trusted Payload with Nomad and WaypointRunning Trusted Payload with Nomad and Waypoint
Running Trusted Payload with Nomad and WaypointBram Vogelaar
 
Easy Cloud Native Transformation using HashiCorp Nomad
Easy Cloud Native Transformation using HashiCorp NomadEasy Cloud Native Transformation using HashiCorp Nomad
Easy Cloud Native Transformation using HashiCorp NomadBram Vogelaar
 
CICD using jenkins and Nomad
CICD using jenkins and NomadCICD using jenkins and Nomad
CICD using jenkins and NomadBram Vogelaar
 
Gamification of Chaos Testing
Gamification of Chaos TestingGamification of Chaos Testing
Gamification of Chaos TestingBram Vogelaar
 
Gamification of Chaos Testing
Gamification of Chaos TestingGamification of Chaos Testing
Gamification of Chaos TestingBram Vogelaar
 
Devops its not about the tooling
Devops its not about the toolingDevops its not about the tooling
Devops its not about the toolingBram Vogelaar
 
High Available Drupal
High Available DrupalHigh Available Drupal
High Available DrupalBram Vogelaar
 
Over engineering your personal website
Over engineering your personal websiteOver engineering your personal website
Over engineering your personal websiteBram Vogelaar
 
testing for people who hate testing
testing for people who hate testingtesting for people who hate testing
testing for people who hate testingBram Vogelaar
 
Terraform for fun and profit
Terraform for fun and profitTerraform for fun and profit
Terraform for fun and profitBram Vogelaar
 
Solid and Infrastructure as Code
Solid and Infrastructure as CodeSolid and Infrastructure as Code
Solid and Infrastructure as CodeBram Vogelaar
 

Más de Bram Vogelaar (19)

Cost reconciliation in a post CMDB world
Cost reconciliation in a post CMDB worldCost reconciliation in a post CMDB world
Cost reconciliation in a post CMDB world
 
Self scaling Multi cloud nomad workloads
Self scaling Multi cloud nomad workloadsSelf scaling Multi cloud nomad workloads
Self scaling Multi cloud nomad workloads
 
Scraping metrics for fun and profit
Scraping metrics for fun and profitScraping metrics for fun and profit
Scraping metrics for fun and profit
 
10 things i learned building nomad-packs
10 things i learned building nomad-packs10 things i learned building nomad-packs
10 things i learned building nomad-packs
 
10 things I learned building Nomad packs
10 things I learned building Nomad packs10 things I learned building Nomad packs
10 things I learned building Nomad packs
 
Easy Cloud Native Transformation with Nomad
Easy Cloud Native Transformation with NomadEasy Cloud Native Transformation with Nomad
Easy Cloud Native Transformation with Nomad
 
Uncomplicated Nomad
Uncomplicated NomadUncomplicated Nomad
Uncomplicated Nomad
 
Observability; a gentle introduction
Observability; a gentle introductionObservability; a gentle introduction
Observability; a gentle introduction
 
Running Trusted Payload with Nomad and Waypoint
Running Trusted Payload with Nomad and WaypointRunning Trusted Payload with Nomad and Waypoint
Running Trusted Payload with Nomad and Waypoint
 
Easy Cloud Native Transformation using HashiCorp Nomad
Easy Cloud Native Transformation using HashiCorp NomadEasy Cloud Native Transformation using HashiCorp Nomad
Easy Cloud Native Transformation using HashiCorp Nomad
 
CICD using jenkins and Nomad
CICD using jenkins and NomadCICD using jenkins and Nomad
CICD using jenkins and Nomad
 
Gamification of Chaos Testing
Gamification of Chaos TestingGamification of Chaos Testing
Gamification of Chaos Testing
 
Gamification of Chaos Testing
Gamification of Chaos TestingGamification of Chaos Testing
Gamification of Chaos Testing
 
Devops its not about the tooling
Devops its not about the toolingDevops its not about the tooling
Devops its not about the tooling
 
High Available Drupal
High Available DrupalHigh Available Drupal
High Available Drupal
 
Over engineering your personal website
Over engineering your personal websiteOver engineering your personal website
Over engineering your personal website
 
testing for people who hate testing
testing for people who hate testingtesting for people who hate testing
testing for people who hate testing
 
Terraform for fun and profit
Terraform for fun and profitTerraform for fun and profit
Terraform for fun and profit
 
Solid and Infrastructure as Code
Solid and Infrastructure as CodeSolid and Infrastructure as Code
Solid and Infrastructure as Code
 

Último

Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 

Último (20)

Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 

Testing your infrastructure with litmus

  • 1. Testing your infrastructure with litmus 04/02/2020 cfgmgmtcamp 2020 Bram Vogelaar @attachmentgenie
  • 2. ~$ whoami ● I used to be a Molecular Biologist, ● Then became a Dev, ● Now an Ops. ● Open Source Consultant @inuits.eu
  • 3. “The intern just “solved” the problem with $product by “fixing” the SSH config”
  • 7. Read out loud warning “Unit testing is a software development process in which the smallest testable parts of an application, called units, are individually and independently scrutinized for proper operation”
  • 8. rspec-puppet ● Independantly developed ● Ruby based ● Rspec based ● (mostly) quick to run ● (almost) unit testing * https://rspec-puppet.com/
  • 9. Rspec test require 'spec_helper' describe 'ssh::server', type: :class do on_supported_os.each do |os, facts| context "on #{os}" do let(:facts) { facts } context 'with defaults for all parameters' do it { is_expected.to contain_class('ssh::server') } it { is_expected.to contain_class('ssh::params') } it do is_expected.to contain_package('openssh-server').with( 'ensure' => 'present', ) end
  • 10. Read out loud warning “An acceptance test is a formal description of the behavior of a software product, generally expressed as an example or a usage scenario”
  • 11. Beaker ● Developed by puppet(labs) ● Ruby based ● Native puppet support ● Docker & Vagrant providers * ● Serverspec https://github.com/puppetlabs/beaker
  • 12. Serverspec describe package('openssh-server') it { should be_installed } end https://serverspec.org/
  • 13. Test Kitchen ● Based on the chef toolchain ● Puppet support via plugin ● Multiple provider support ● Inspec (and serverspec) support https://github.com/neillturner/kitchen-puppet
  • 14. inspec control 'ports-1.0' do impact 1.0 title 'Port 9000 should have a fpm pool listening' describe port(9000) do it { should be_listening } its('processes') {should include 'php-fpm'} end end https://www.inspec.io/
  • 15. Inspec (audit) profiles include_controls 'linux-baseline' https://dev-sec.io/
  • 16. Highly Opinionated Awkward Bits ● Designed for single node testing only * ● Rage inducing CLI (beaker) ● Weird CLI verbs (kitchen) ● No orchestration (kitchen) ● License issues (inspec)
  • 17.
  • 18. Litmus ● Developed by puppet ● Ruby based ● Native puppet support ● Docker & Vagrant providers ● Server-spec ● Build on puppet’s Bolt ● Multi node support https://github.com/puppetlabs/puppet_litmus
  • 20. bootstrap # Start a docker image >bundle exec rake 'litmus:provision[docker, centos:7]' # Start all nodes defined it the vagrant list >bundle exec rake 'litmus:provision[vagrant]' Provisioning centos_7-2222 {"status":"ok","node_name":"localhost"}
  • 21. Inventory.yml > cat inventory.yaml --- groups: - name: ssh_nodes nodes: - name: localhost:2222 config: transport: ssh ssh: user: root password: root port: 2222 host-key-check: false facts: provisioner: docker container_name: centos_7-2222
  • 22. Batteries not included? # Installs the latest Puppet Agent on all targets > bundle exec rake "litmus:install_agent" # Installs Puppet 5 on all targets > bundle exec rake 'litmus:install_agent[puppet5]' # Install the latest Puppet Agent on a specific target > bundle exec rake 'litmus:install_agent[foo.bar.bbq]'
  • 23. Bolt > bolt command run 'puppet --version' -n localhost:2222 -i inventory.yaml Started on localhost... Finished on localhost: STDOUT: 6.12.0 Successful on 1 node: localhost:2222 Ran on 1 node in 0.92 seconds
  • 24. Multi-node Setup > bundle exec bolt --modulepath $(pwd)/spec/fixtures/modules/ plan run provision::server_setup --inventoryfile inventory.yaml > bundle exec bolt --modulepath $(pwd)/spec/fixtures/modules/ plan run provision::agents --inventoryfile inventory.yaml
  • 25. Push your code > bundle exec rake litmus:install_module
  • 26. Fire in the hole! > bundle exec rake litmus:acceptance:parallel Running against 1 machines |Time: 00:00:48 | ================================================================== ====================== | Time: 00:00:48 ...... Finished in 46.38 seconds (files took 1.97 seconds to load) 6 examples, 0 failures
  • 27. Fire in the hole! > bundle exec rake litmus:acceptance:parallel Running against 1 machines |Time: 00:00:48 | ================================================================== ====================== | Time: 00:00:48 ...... Finished in 46.38 seconds (files took 1.97 seconds to load) 6 examples, 0 failures
  • 28. Granularity > TARGET_HOST=foo.bar.bbq bundle exec rspec ./spec/acceptance > bundle exec rspec ./spec/acceptance/test_spec.rb:21
  • 29. Release Resources > bundle exec rake litmus:tear_down {"node"=>"localhost", "status"=>"success", "result"=>{"_output"=>"Removed localhost:2222 n{"status":"ok"}n"}}
  • 30. .travis.yml before_script: ["bundle exec rake 'litmus:provision_list[travis_deb]'", "bundle exec rake 'litmus:install_agent[puppet6]'", "bundle exec rake litmus:install_module"] bundler_args: dist: trusty env: PLATFORMS=deb_puppet6 rvm: 2.5.1 script: ["bundle exec rake litmus:acceptance:parallel"] services: docker stage: acceptance sudo: required
  • 31. INUITS bvba Essensteenweg 31 2930 Brasschaat Belgium BE 0891.514.231 Contact: +32.380.821.05 info@inuits.eu inuits.eu bram@inuits.eu @attachmentgenie