SlideShare ist ein Scribd-Unternehmen logo
1 von 31
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

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
Bram 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 Conf
Tom Croucher
 

Was ist angesagt? (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
 

Ähnlich wie Testing your infrastructure with litmus

Node.js basics
Node.js basicsNode.js basics
Node.js basics
Ben Lin
 
Installaling Puppet Master and Agent
Installaling Puppet Master and AgentInstallaling Puppet Master and Agent
Installaling Puppet Master and Agent
Ranjit Avasarala
 

Ähnlich wie 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
 

Mehr von Bram Vogelaar

Observability; a gentle introduction
Observability; a gentle introductionObservability; a gentle introduction
Observability; a gentle introduction
Bram Vogelaar
 

Mehr von 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
 

Kürzlich hochgeladen

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Kürzlich hochgeladen (20)

Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
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...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

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