SlideShare a Scribd company logo
1 of 47
Download to read offline
Friday, February 1, 13
I am:       Daniele Sluijters (daenney)



           I work for:   Nedap Stepping Stone



            I help:      Developers host and scale
                                their applications



Friday, February 1, 13
Friday, February 1, 13
Friday, February 1, 13
Friday, February 1, 13
Departments


                         • Catering for everyone’s needs
                         • From a single codebase...


Friday, February 1, 13
So, Puppet...



Friday, February 1, 13
Why
                         • Started to backsource our hosting.
                         • Need for automation to grow quickly.
                         • Single point of administration.
                         • Servers bootstrapped through FAI.
                         • Puppet does the rest.
Friday, February 1, 13
Early days
                         • Puppet: 0.25 - 2.6.
                         • Puppet changing at a rapid pace.
                         • Our manifests growing exponentially.
                         • Manifests, modules, nodes, argh.

Friday, February 1, 13
Growing
                         • Limited knowledge on creating Puppet
                           modules.

                         • Sparse information on how to create
                           good modules.

                         • Difficult to separate logic from data.
                         • Lots and lots of nagios hosts, services
                           and checks.

Friday, February 1, 13
© Jose CP, http://www.flickr.com/photos/andvaranaut/1534670848/
Friday, February 1, 13
Fixing
                         • Admit you have a problem...
                         • Take time to fix it!
                         • Introduce Hiera for data.
                         • Split modules in small, simple, classes.
                         • Tests, tests, tests!

Friday, February 1, 13
Devil in the details...



Friday, February 1, 13
Testing
                         class	
  supervisor	
  {
                           package	
  {	
  ‘supervisor’:
                             ensure	
  	
  	
  =>	
  latest,

                             }
                         }



Friday, February 1, 13
Testing
                         class	
  supervisor	
  {
                           package	
  {	
  ‘supervisor’:
                             ensure	
  	
  	
  =>	
  latest,
                             provider	
  =>	
  ‘pip’,
                           }
                         }



Friday, February 1, 13
Update everything!

                         class	
  mysql::server	
  {
                           package	
  {	
  ‘mysql-­‐server’:
                             ensure	
  =>	
  latest,
                           }
                         }



Friday, February 1, 13
Update everything!
                         class	
  puppet::agent	
  {
                            package	
  {	
  ‘puppet’:
                              ensure	
  =>	
  latest,
                            }
                         }
                         class	
  puppet::master	
  {
                            package	
  {	
  ‘puppetmaster’:
                              ensure	
  =>	
  latest,
                            }
                          }
Friday, February 1, 13
© Joe Mott, http://www.flickr.com/photos/motti82/3778598336/
Friday, February 1, 13
Schedule!
                         schedule	
  {	
  'never':
                            period	
  =>	
  ‘never’,
                         }

                         class	
  mysql::master	
  {
                            service	
  {	
  ‘mysql’:
                              schedule	
  =>	
  never,
                            }
                          }

Friday, February 1, 13
We’ve got issues...



Friday, February 1, 13
Data

                         • Not possible to keep
                           everything in one place

                         • Duplication of data within a
                           single source




Friday, February 1, 13
Community
                         • Help people first...
                         • Then tell them they’re doing it
                           wrong.




Friday, February 1, 13
Community
                         • Help people first...
                         • Then tell them they’re doing it
                           wrong.


                         • 2.7.0 is the first version of
                           Puppet to support Ruby 1.9.


Friday, February 1, 13
Nagios




Friday, February 1, 13
Nagios
     • Puppet report
      • config retrieval:   113.85s

      • runtime:           155.21s




Friday, February 1, 13
Nagios
     • Puppet report
      • config retrieval: 113.85s
      • runtime:          155.21s

     • time puppet agent --onetime --no-daemonize
      • real: 23m 28.201s
      • user: 21m 9.239s
      • sys: 0m 24.026s
Friday, February 1, 13
rspec-puppet



Friday, February 1, 13
Getting started
            source	
  :rubygems
            gem	
  'puppet',	
  '~>	
  2.7.20'
            gem	
  'facter',	
  '~>	
  1.6.15'
            gem	
  'puppet-­‐lint',	
  '~>	
  0.3.2'
            gem	
  'rspec-­‐puppet',	
  '~>	
  0.1.5'
            gem	
  'puppetlabs_spec_helper',	
  '~>	
  0.4.0'




Friday, February 1, 13
Getting started

                         • Aren’t always up to date
                         • Not using rspec-­‐puppet-­‐init
                         • .fixtures.yml with
                           puppetlabs_spec_helper




Friday, February 1, 13
Scaffolding
     $ cd	
  modules/modulename
     $ mkdir	
  -­‐p	
  spec/{defines,	
  classes,	
  
              functions,	
  hosts,	
  fixtures}
     $ echo	
  "require	
  'puppetlabs_spec_helper/
              module_spec_helper'"	
  >	
  "spec/
              spec_helper.rb"
     $ echo	
  "require	
  'puppetlabs_spec_helper/
              rake_tasks'"	
  >	
  "Rakefile"
Friday, February 1, 13
Scaffolding
    $	
  cat	
  .fixtures.yml
            fixtures:
            	
  	
  symlinks:
            	
  	
  	
  	
  stdlib:	
  "#{source_dir}/../stdlib"
            	
  	
  	
  	
  webapp:	
  "#{source_dir}"




Friday, February 1, 13
Testing yolo
                         class	
  yolo	
  {
                         	
  	
  notic	
  {	
  'yolo':	
  }
                         }


                         require	
  'spec_helper'
                         describe	
  'yolo'	
  do
                         	
  	
  it	
  "should	
  build"	
  do
                         	
  	
  	
  	
  should	
  contain_class('yolo')
                         	
  	
  end
                         end
Friday, February 1, 13
Testing yolo
        rake	
  spec
        Failures:
        	
  	
  1)	
  yolo	
  should	
  build
        	
  	
  	
  	
  	
  Failure/Error:	
  should	
  contain_class('yolo')
        	
  	
  	
  	
  	
  Puppet::Error:
        	
  	
  	
  	
  	
  	
  	
  Puppet::Parser::AST::Resource	
  failed	
  with	
  
        error	
  ArgumentError:	
  Invalid	
  resource	
  type	
  notic	
  
        at	
  yolo/manifests/init.pp:40	
  

        #	
  ./spec/classes/yolo_spec.rb:5
        Finished	
  in	
  0.0809	
  seconds
        1	
  example,	
  1	
  failure

Friday, February 1, 13
Fail fast
                         class	
  yolo	
  (	
  $param	
  =	
  false,	
  ){
                         	
  	
  validate_string($param)
                         }

                         require	
  'spec_helper'
                         describe	
  'yolo'	
  do
                         	
  	
  it	
  "should	
  build"	
  do
                         	
  	
  	
  	
  should	
  contain_class('yolo')
                         	
  	
  end
                         end

Friday, February 1, 13
Fail fast
        rake	
  spec
        Failures:
        	
  	
  1)	
  yolo	
  should	
  build
        	
  	
  	
  	
  	
  Failure/Error:	
  should	
  contain_class('yolo')
        	
  	
  	
  	
  	
  Puppet::Error:
        	
  	
  	
  	
  	
  	
  	
  false	
  is	
  not	
  a	
  string.	
  	
  It	
  looks	
  to	
  be	
  a	
  
        FalseClass	
  at	
  yolo/manifests/init.pp:40

        #	
  ./spec/classes/yolo_spec.rb:5
        Finished	
  in	
  0.0809	
  seconds
        1	
  example,	
  1	
  failure


Friday, February 1, 13
Fail more
                    class	
  yolo	
  (	
  $param=false,	
  ){
                    	
  	
  validate_string($param)
                    	
  	
  if	
  empty($param){
                    	
  	
  	
  	
  fail(‘Dude,	
  wth,	
  empty?!’)
                    	
  	
  }
                    }

                    require	
  'spec_helper'
                    describe	
  'yolo'	
  do
                    let	
  :params	
  do	
  {	
  :param	
  =>	
  ''	
  }	
  end
                    	
  	
  [..]
                    end
Friday, February 1, 13
Fail more
        rake	
  spec
        Failures:
        	
  	
  1)	
  yolo	
  should	
  build
        	
  	
  	
  	
  	
  Failure/Error:	
  should	
  contain_class('yolo')
        	
  	
  	
  	
  	
  Puppet::Error:
        	
  	
  	
  	
  	
  	
  	
  Dude,	
  wth,	
  empty?!	
  at	
  yolo/manifests/
        init.pp:43

        #	
  ./spec/classes/yolo_spec.rb:5
        Finished	
  in	
  0.0809	
  seconds
        1	
  example,	
  1	
  failure


Friday, February 1, 13
Check your validation
       require	
  'spec_helper'

       describe	
  'yolo'	
  do
       	
  	
  context	
  'with	
  invalid	
  $param	
  type'	
  do
       	
  	
  	
  	
  let	
  :params	
  do	
  {	
  :param	
  =>	
  {}	
  }	
  end
       	
  	
  	
  	
  it	
  "should	
  break	
  horribly"	
  do
       	
  	
  	
  	
  	
  	
  expect	
  {	
  subject	
  }.to	
  
       raise_error(Puppet::Error,	
  
       	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  /{}	
  is	
  not	
  a	
  string/)
       	
  	
  	
  	
  end
       	
  	
  end
       end

Friday, February 1, 13
Check your validation

       rake	
  spec
       .

       Finished	
  in	
  0.08736	
  seconds
       1	
  example,	
  0	
  failures




Friday, February 1, 13
Check your facts

       class	
  yolo(
       	
  	
  $param	
  =	
  $yolo::params::lol
       )	
  inherits	
  yolo::params	
  {

       	
  	
  [do	
  stuff,	
  like	
  validation]

       }




Friday, February 1, 13
Check your facts
       class	
  yolo::params	
  {
       	
  	
  case	
  $::osfamily	
  {
       	
  	
  	
  	
  'Debian':	
  {
       	
  	
  	
  	
  	
  	
  [set	
  some	
  really	
  fancy	
  variables]
       	
  	
  	
  	
  }

       	
  	
  	
  	
  default:	
  {
       	
  	
  	
  	
  	
  	
  fail("$osfamily	
  ${::osfamily}	
  is	
  not	
  
       supported	
  by	
  the	
  yolo	
  module.")
       	
  	
  	
  	
  }
       	
  	
  }
       }

Friday, February 1, 13
Check your facts
       	
  	
  describe	
  'on	
  unsupported'	
  do
       	
  	
  	
  	
  let	
  :facts	
  do
       	
  	
  	
  	
  	
  	
  {	
  :osfamily	
  =>	
  'Little	
  Red	
  Riding	
  Hood'	
  }
       	
  	
  	
  	
  end

       	
  	
  	
  	
  it	
  'should	
  fail'	
  do
       	
  	
  	
  	
  	
  	
  expect	
  {	
  subject	
  }.to	
  raise_error(/
       osfamily	
  Little	
  Red	
  Riding	
  Hood	
  is	
  not	
  
       supported/)
       	
  	
  	
  	
  end
       	
  	
  end


Friday, February 1, 13
Check your resources

       class	
  yolo::configs	
  {
       	
  	
  file	
  {	
  $f_yolo_default:
       	
  	
  	
  	
  #	
  Template	
  uses	
  $interfaces
       	
  	
  	
  	
  content	
  =>	
  template('yolo/default.erb'),
       	
  	
  }
       }




Friday, February 1, 13
Check your resources
       describe	
  'yolo::configs'	
  do
       	
  	
  let	
  :params	
  do
       	
  	
  	
  	
  {	
  :f_yolo_default	
  =>	
  '/etc/default/yolo',}
       	
  	
  end

       	
  	
  it	
  do
       	
  	
  	
  	
  should	
  contain_file('/etc/default	
  
       yolo').with_content(/CATS="lol"/)
       	
  	
  	
  	
  end
       end


Friday, February 1, 13
Matchers
    • For every resource: contain_resource()
    • For every attribute: with_attr(‘value’)
    • Or: with({:attr1	
  =>	
  ‘value1’,	
  :attr2	
  =>	
  
             ‘value2’})

    • Check the content:	
  with_content(regex)
    • include_class()
Friday, February 1, 13
Helpers

    • let	
  :params	
  do	
  {	
  :param	
  =>	
  {}	
  }	
  end
    • let	
  :facts	
  do	
  {	
  :osfamily	
  =>	
  ‘’	
  }	
  end
    • let	
  :pre_condition	
  do	
  'include	
  
             class::we::need'	
  end




Friday, February 1, 13
© Vinoth Chandar, http://www.flickr.com/photos/vinothchandar/4278047231/
Friday, February 1, 13

More Related Content

Viewers also liked

How to measure customer experience to improve satisfaction and loyalty
How to measure customer experience to improve satisfaction and loyaltyHow to measure customer experience to improve satisfaction and loyalty
How to measure customer experience to improve satisfaction and loyaltydigbyj
 
brochure_Ageneric_web
brochure_Ageneric_webbrochure_Ageneric_web
brochure_Ageneric_webTalat Erden
 
qulak customer satisfaction measurement system
qulak customer satisfaction measurement systemqulak customer satisfaction measurement system
qulak customer satisfaction measurement systemahmed zareer
 
Listen, see, measure on social media
Listen, see, measure on social media Listen, see, measure on social media
Listen, see, measure on social media Hatem Kameli
 
Net Promoter Score (NPS) - Measure Customer Satisfaction in 1 Question
Net Promoter Score (NPS) - Measure Customer Satisfaction in 1 QuestionNet Promoter Score (NPS) - Measure Customer Satisfaction in 1 Question
Net Promoter Score (NPS) - Measure Customer Satisfaction in 1 QuestionCheckMarket
 
What Is Customer Effort Score and How Do You Measure CES?
What Is Customer Effort Score and How Do You Measure CES?What Is Customer Effort Score and How Do You Measure CES?
What Is Customer Effort Score and How Do You Measure CES?Kayako
 
How to Measure Net Promoter Score (NPS)
How to Measure Net Promoter Score (NPS)How to Measure Net Promoter Score (NPS)
How to Measure Net Promoter Score (NPS)Kayako
 
Designing a Customer Feedback Program to Measure and Improve User Satisfaction
Designing a Customer Feedback Program to Measure and Improve User SatisfactionDesigning a Customer Feedback Program to Measure and Improve User Satisfaction
Designing a Customer Feedback Program to Measure and Improve User SatisfactionUserZoom
 
7 steps to successful customer experience measurement programs
7 steps to successful customer experience measurement programs7 steps to successful customer experience measurement programs
7 steps to successful customer experience measurement programsDatafield
 
How to Measure Your Customer Satisfaction Score (CSAT)
How to Measure Your Customer Satisfaction Score (CSAT)How to Measure Your Customer Satisfaction Score (CSAT)
How to Measure Your Customer Satisfaction Score (CSAT)Kayako
 

Viewers also liked (13)

How to measure customer experience to improve satisfaction and loyalty
How to measure customer experience to improve satisfaction and loyaltyHow to measure customer experience to improve satisfaction and loyalty
How to measure customer experience to improve satisfaction and loyalty
 
brochure_Ageneric_web
brochure_Ageneric_webbrochure_Ageneric_web
brochure_Ageneric_web
 
qulak customer satisfaction measurement system
qulak customer satisfaction measurement systemqulak customer satisfaction measurement system
qulak customer satisfaction measurement system
 
Listen, see, measure on social media
Listen, see, measure on social media Listen, see, measure on social media
Listen, see, measure on social media
 
Net Promoter Score
Net Promoter ScoreNet Promoter Score
Net Promoter Score
 
Net Promoter Score (NPS) - Measure Customer Satisfaction in 1 Question
Net Promoter Score (NPS) - Measure Customer Satisfaction in 1 QuestionNet Promoter Score (NPS) - Measure Customer Satisfaction in 1 Question
Net Promoter Score (NPS) - Measure Customer Satisfaction in 1 Question
 
What Is Customer Effort Score and How Do You Measure CES?
What Is Customer Effort Score and How Do You Measure CES?What Is Customer Effort Score and How Do You Measure CES?
What Is Customer Effort Score and How Do You Measure CES?
 
How to Measure Net Promoter Score (NPS)
How to Measure Net Promoter Score (NPS)How to Measure Net Promoter Score (NPS)
How to Measure Net Promoter Score (NPS)
 
Designing a Customer Feedback Program to Measure and Improve User Satisfaction
Designing a Customer Feedback Program to Measure and Improve User SatisfactionDesigning a Customer Feedback Program to Measure and Improve User Satisfaction
Designing a Customer Feedback Program to Measure and Improve User Satisfaction
 
Measuring Customer Satisfaction
Measuring Customer SatisfactionMeasuring Customer Satisfaction
Measuring Customer Satisfaction
 
Customer satisfaction
Customer satisfactionCustomer satisfaction
Customer satisfaction
 
7 steps to successful customer experience measurement programs
7 steps to successful customer experience measurement programs7 steps to successful customer experience measurement programs
7 steps to successful customer experience measurement programs
 
How to Measure Your Customer Satisfaction Score (CSAT)
How to Measure Your Customer Satisfaction Score (CSAT)How to Measure Your Customer Satisfaction Score (CSAT)
How to Measure Your Customer Satisfaction Score (CSAT)
 

Similar to Puppet @ Nedap

State of Puppet
State of PuppetState of Puppet
State of PuppetPuppet
 
Designing Puppet: Roles/Profiles Pattern
Designing Puppet: Roles/Profiles PatternDesigning Puppet: Roles/Profiles Pattern
Designing Puppet: Roles/Profiles PatternPuppet
 
Building scalable applications while scaling your infrastructure by rhommel l...
Building scalable applications while scaling your infrastructure by rhommel l...Building scalable applications while scaling your infrastructure by rhommel l...
Building scalable applications while scaling your infrastructure by rhommel l...Puppet
 
State of Puppet - Puppet Camp Barcelona 2013
State of Puppet - Puppet Camp Barcelona 2013State of Puppet - Puppet Camp Barcelona 2013
State of Puppet - Puppet Camp Barcelona 2013Puppet
 
Building scalable applications while scaling your infrastructure by rhommel l...
Building scalable applications while scaling your infrastructure by rhommel l...Building scalable applications while scaling your infrastructure by rhommel l...
Building scalable applications while scaling your infrastructure by rhommel l...NETWAYS
 
The State of Puppet
The State of PuppetThe State of Puppet
The State of PuppetPuppet
 
Javascript in the cloud
Javascript in the cloudJavascript in the cloud
Javascript in the cloudMostafa Eweda
 
Testing Adhearsion Applications
Testing Adhearsion ApplicationsTesting Adhearsion Applications
Testing Adhearsion ApplicationsMojo Lingo
 
Puppet Camp Berlin 2014: Advanced Puppet Design
Puppet Camp Berlin 2014: Advanced Puppet DesignPuppet Camp Berlin 2014: Advanced Puppet Design
Puppet Camp Berlin 2014: Advanced Puppet DesignPuppet
 
Test Driven Infrastructure Development
Test Driven Infrastructure DevelopmentTest Driven Infrastructure Development
Test Driven Infrastructure DevelopmentPuppet
 
Test driven infrastructure development
Test driven infrastructure developmentTest driven infrastructure development
Test driven infrastructure developmentTomas Doran
 
Writing Reusable Web Components with jQuery and jQuery UI
Writing Reusable Web Components with jQuery and jQuery UIWriting Reusable Web Components with jQuery and jQuery UI
Writing Reusable Web Components with jQuery and jQuery UIYnon Perek
 
Disconnecting the Database with ActiveRecord
Disconnecting the Database with ActiveRecordDisconnecting the Database with ActiveRecord
Disconnecting the Database with ActiveRecordBen Mabey
 
Use Ruby to Write (and Test) Your Next Android App
Use Ruby to Write (and Test) Your Next Android AppUse Ruby to Write (and Test) Your Next Android App
Use Ruby to Write (and Test) Your Next Android AppJoel Byler
 
High Performance Ruby - E4E Conference 2013
High Performance Ruby - E4E Conference 2013High Performance Ruby - E4E Conference 2013
High Performance Ruby - E4E Conference 2013Charles Nutter
 
Building Reusable Puppet Modules
Building Reusable Puppet ModulesBuilding Reusable Puppet Modules
Building Reusable Puppet ModulesPuppet
 
GitHub Notable OSS Project
GitHub  Notable OSS ProjectGitHub  Notable OSS Project
GitHub Notable OSS Projectroumia
 
Integrating Voice Through Adhearsion
Integrating Voice Through AdhearsionIntegrating Voice Through Adhearsion
Integrating Voice Through AdhearsionMojo Lingo
 

Similar to Puppet @ Nedap (20)

State of Puppet
State of PuppetState of Puppet
State of Puppet
 
Designing Puppet: Roles/Profiles Pattern
Designing Puppet: Roles/Profiles PatternDesigning Puppet: Roles/Profiles Pattern
Designing Puppet: Roles/Profiles Pattern
 
Building scalable applications while scaling your infrastructure by rhommel l...
Building scalable applications while scaling your infrastructure by rhommel l...Building scalable applications while scaling your infrastructure by rhommel l...
Building scalable applications while scaling your infrastructure by rhommel l...
 
State of Puppet - Puppet Camp Barcelona 2013
State of Puppet - Puppet Camp Barcelona 2013State of Puppet - Puppet Camp Barcelona 2013
State of Puppet - Puppet Camp Barcelona 2013
 
Building scalable applications while scaling your infrastructure by rhommel l...
Building scalable applications while scaling your infrastructure by rhommel l...Building scalable applications while scaling your infrastructure by rhommel l...
Building scalable applications while scaling your infrastructure by rhommel l...
 
The State of Puppet
The State of PuppetThe State of Puppet
The State of Puppet
 
Javascript in the cloud
Javascript in the cloudJavascript in the cloud
Javascript in the cloud
 
Testing Adhearsion Applications
Testing Adhearsion ApplicationsTesting Adhearsion Applications
Testing Adhearsion Applications
 
Puppet Camp Berlin 2014: Advanced Puppet Design
Puppet Camp Berlin 2014: Advanced Puppet DesignPuppet Camp Berlin 2014: Advanced Puppet Design
Puppet Camp Berlin 2014: Advanced Puppet Design
 
Test Driven Infrastructure Development
Test Driven Infrastructure DevelopmentTest Driven Infrastructure Development
Test Driven Infrastructure Development
 
Test driven infrastructure development
Test driven infrastructure developmentTest driven infrastructure development
Test driven infrastructure development
 
Play 2 pip
Play 2 pipPlay 2 pip
Play 2 pip
 
Writing Reusable Web Components with jQuery and jQuery UI
Writing Reusable Web Components with jQuery and jQuery UIWriting Reusable Web Components with jQuery and jQuery UI
Writing Reusable Web Components with jQuery and jQuery UI
 
Disconnecting the Database with ActiveRecord
Disconnecting the Database with ActiveRecordDisconnecting the Database with ActiveRecord
Disconnecting the Database with ActiveRecord
 
Use Ruby to Write (and Test) Your Next Android App
Use Ruby to Write (and Test) Your Next Android AppUse Ruby to Write (and Test) Your Next Android App
Use Ruby to Write (and Test) Your Next Android App
 
Plumbr case study
Plumbr case studyPlumbr case study
Plumbr case study
 
High Performance Ruby - E4E Conference 2013
High Performance Ruby - E4E Conference 2013High Performance Ruby - E4E Conference 2013
High Performance Ruby - E4E Conference 2013
 
Building Reusable Puppet Modules
Building Reusable Puppet ModulesBuilding Reusable Puppet Modules
Building Reusable Puppet Modules
 
GitHub Notable OSS Project
GitHub  Notable OSS ProjectGitHub  Notable OSS Project
GitHub Notable OSS Project
 
Integrating Voice Through Adhearsion
Integrating Voice Through AdhearsionIntegrating Voice Through Adhearsion
Integrating Voice Through Adhearsion
 

More from Puppet

Puppet camp2021 testing modules and controlrepo
Puppet camp2021 testing modules and controlrepoPuppet camp2021 testing modules and controlrepo
Puppet camp2021 testing modules and controlrepoPuppet
 
Puppetcamp r10kyaml
Puppetcamp r10kyamlPuppetcamp r10kyaml
Puppetcamp r10kyamlPuppet
 
2021 04-15 operational verification (with notes)
2021 04-15 operational verification (with notes)2021 04-15 operational verification (with notes)
2021 04-15 operational verification (with notes)Puppet
 
Puppet camp vscode
Puppet camp vscodePuppet camp vscode
Puppet camp vscodePuppet
 
Modules of the twenties
Modules of the twentiesModules of the twenties
Modules of the twentiesPuppet
 
Applying Roles and Profiles method to compliance code
Applying Roles and Profiles method to compliance codeApplying Roles and Profiles method to compliance code
Applying Roles and Profiles method to compliance codePuppet
 
KGI compliance as-code approach
KGI compliance as-code approachKGI compliance as-code approach
KGI compliance as-code approachPuppet
 
Enforce compliance policy with model-driven automation
Enforce compliance policy with model-driven automationEnforce compliance policy with model-driven automation
Enforce compliance policy with model-driven automationPuppet
 
Keynote: Puppet camp compliance
Keynote: Puppet camp complianceKeynote: Puppet camp compliance
Keynote: Puppet camp compliancePuppet
 
Automating it management with Puppet + ServiceNow
Automating it management with Puppet + ServiceNowAutomating it management with Puppet + ServiceNow
Automating it management with Puppet + ServiceNowPuppet
 
Puppet: The best way to harden Windows
Puppet: The best way to harden WindowsPuppet: The best way to harden Windows
Puppet: The best way to harden WindowsPuppet
 
Simplified Patch Management with Puppet - Oct. 2020
Simplified Patch Management with Puppet - Oct. 2020Simplified Patch Management with Puppet - Oct. 2020
Simplified Patch Management with Puppet - Oct. 2020Puppet
 
Accelerating azure adoption with puppet
Accelerating azure adoption with puppetAccelerating azure adoption with puppet
Accelerating azure adoption with puppetPuppet
 
Puppet catalog Diff; Raphael Pinson
Puppet catalog Diff; Raphael PinsonPuppet catalog Diff; Raphael Pinson
Puppet catalog Diff; Raphael PinsonPuppet
 
ServiceNow and Puppet- better together, Kevin Reeuwijk
ServiceNow and Puppet- better together, Kevin ReeuwijkServiceNow and Puppet- better together, Kevin Reeuwijk
ServiceNow and Puppet- better together, Kevin ReeuwijkPuppet
 
Take control of your dev ops dumping ground
Take control of your  dev ops dumping groundTake control of your  dev ops dumping ground
Take control of your dev ops dumping groundPuppet
 
100% Puppet Cloud Deployment of Legacy Software
100% Puppet Cloud Deployment of Legacy Software100% Puppet Cloud Deployment of Legacy Software
100% Puppet Cloud Deployment of Legacy SoftwarePuppet
 
Puppet User Group
Puppet User GroupPuppet User Group
Puppet User GroupPuppet
 
Continuous Compliance and DevSecOps
Continuous Compliance and DevSecOpsContinuous Compliance and DevSecOps
Continuous Compliance and DevSecOpsPuppet
 
The Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick Maludy
The Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick MaludyThe Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick Maludy
The Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick MaludyPuppet
 

More from Puppet (20)

Puppet camp2021 testing modules and controlrepo
Puppet camp2021 testing modules and controlrepoPuppet camp2021 testing modules and controlrepo
Puppet camp2021 testing modules and controlrepo
 
Puppetcamp r10kyaml
Puppetcamp r10kyamlPuppetcamp r10kyaml
Puppetcamp r10kyaml
 
2021 04-15 operational verification (with notes)
2021 04-15 operational verification (with notes)2021 04-15 operational verification (with notes)
2021 04-15 operational verification (with notes)
 
Puppet camp vscode
Puppet camp vscodePuppet camp vscode
Puppet camp vscode
 
Modules of the twenties
Modules of the twentiesModules of the twenties
Modules of the twenties
 
Applying Roles and Profiles method to compliance code
Applying Roles and Profiles method to compliance codeApplying Roles and Profiles method to compliance code
Applying Roles and Profiles method to compliance code
 
KGI compliance as-code approach
KGI compliance as-code approachKGI compliance as-code approach
KGI compliance as-code approach
 
Enforce compliance policy with model-driven automation
Enforce compliance policy with model-driven automationEnforce compliance policy with model-driven automation
Enforce compliance policy with model-driven automation
 
Keynote: Puppet camp compliance
Keynote: Puppet camp complianceKeynote: Puppet camp compliance
Keynote: Puppet camp compliance
 
Automating it management with Puppet + ServiceNow
Automating it management with Puppet + ServiceNowAutomating it management with Puppet + ServiceNow
Automating it management with Puppet + ServiceNow
 
Puppet: The best way to harden Windows
Puppet: The best way to harden WindowsPuppet: The best way to harden Windows
Puppet: The best way to harden Windows
 
Simplified Patch Management with Puppet - Oct. 2020
Simplified Patch Management with Puppet - Oct. 2020Simplified Patch Management with Puppet - Oct. 2020
Simplified Patch Management with Puppet - Oct. 2020
 
Accelerating azure adoption with puppet
Accelerating azure adoption with puppetAccelerating azure adoption with puppet
Accelerating azure adoption with puppet
 
Puppet catalog Diff; Raphael Pinson
Puppet catalog Diff; Raphael PinsonPuppet catalog Diff; Raphael Pinson
Puppet catalog Diff; Raphael Pinson
 
ServiceNow and Puppet- better together, Kevin Reeuwijk
ServiceNow and Puppet- better together, Kevin ReeuwijkServiceNow and Puppet- better together, Kevin Reeuwijk
ServiceNow and Puppet- better together, Kevin Reeuwijk
 
Take control of your dev ops dumping ground
Take control of your  dev ops dumping groundTake control of your  dev ops dumping ground
Take control of your dev ops dumping ground
 
100% Puppet Cloud Deployment of Legacy Software
100% Puppet Cloud Deployment of Legacy Software100% Puppet Cloud Deployment of Legacy Software
100% Puppet Cloud Deployment of Legacy Software
 
Puppet User Group
Puppet User GroupPuppet User Group
Puppet User Group
 
Continuous Compliance and DevSecOps
Continuous Compliance and DevSecOpsContinuous Compliance and DevSecOps
Continuous Compliance and DevSecOps
 
The Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick Maludy
The Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick MaludyThe Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick Maludy
The Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick Maludy
 

Recently uploaded

Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 

Recently uploaded (20)

Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 

Puppet @ Nedap

  • 2. I am: Daniele Sluijters (daenney) I work for: Nedap Stepping Stone I help: Developers host and scale their applications Friday, February 1, 13
  • 6. Departments • Catering for everyone’s needs • From a single codebase... Friday, February 1, 13
  • 8. Why • Started to backsource our hosting. • Need for automation to grow quickly. • Single point of administration. • Servers bootstrapped through FAI. • Puppet does the rest. Friday, February 1, 13
  • 9. Early days • Puppet: 0.25 - 2.6. • Puppet changing at a rapid pace. • Our manifests growing exponentially. • Manifests, modules, nodes, argh. Friday, February 1, 13
  • 10. Growing • Limited knowledge on creating Puppet modules. • Sparse information on how to create good modules. • Difficult to separate logic from data. • Lots and lots of nagios hosts, services and checks. Friday, February 1, 13
  • 11. © Jose CP, http://www.flickr.com/photos/andvaranaut/1534670848/ Friday, February 1, 13
  • 12. Fixing • Admit you have a problem... • Take time to fix it! • Introduce Hiera for data. • Split modules in small, simple, classes. • Tests, tests, tests! Friday, February 1, 13
  • 13. Devil in the details... Friday, February 1, 13
  • 14. Testing class  supervisor  { package  {  ‘supervisor’: ensure      =>  latest, } } Friday, February 1, 13
  • 15. Testing class  supervisor  { package  {  ‘supervisor’: ensure      =>  latest, provider  =>  ‘pip’, } } Friday, February 1, 13
  • 16. Update everything! class  mysql::server  { package  {  ‘mysql-­‐server’: ensure  =>  latest, } } Friday, February 1, 13
  • 17. Update everything! class  puppet::agent  { package  {  ‘puppet’: ensure  =>  latest, } } class  puppet::master  { package  {  ‘puppetmaster’: ensure  =>  latest, } } Friday, February 1, 13
  • 18. © Joe Mott, http://www.flickr.com/photos/motti82/3778598336/ Friday, February 1, 13
  • 19. Schedule! schedule  {  'never': period  =>  ‘never’, } class  mysql::master  { service  {  ‘mysql’: schedule  =>  never, } } Friday, February 1, 13
  • 21. Data • Not possible to keep everything in one place • Duplication of data within a single source Friday, February 1, 13
  • 22. Community • Help people first... • Then tell them they’re doing it wrong. Friday, February 1, 13
  • 23. Community • Help people first... • Then tell them they’re doing it wrong. • 2.7.0 is the first version of Puppet to support Ruby 1.9. Friday, February 1, 13
  • 25. Nagios • Puppet report • config retrieval: 113.85s • runtime: 155.21s Friday, February 1, 13
  • 26. Nagios • Puppet report • config retrieval: 113.85s • runtime: 155.21s • time puppet agent --onetime --no-daemonize • real: 23m 28.201s • user: 21m 9.239s • sys: 0m 24.026s Friday, February 1, 13
  • 28. Getting started source  :rubygems gem  'puppet',  '~>  2.7.20' gem  'facter',  '~>  1.6.15' gem  'puppet-­‐lint',  '~>  0.3.2' gem  'rspec-­‐puppet',  '~>  0.1.5' gem  'puppetlabs_spec_helper',  '~>  0.4.0' Friday, February 1, 13
  • 29. Getting started • Aren’t always up to date • Not using rspec-­‐puppet-­‐init • .fixtures.yml with puppetlabs_spec_helper Friday, February 1, 13
  • 30. Scaffolding $ cd  modules/modulename $ mkdir  -­‐p  spec/{defines,  classes,   functions,  hosts,  fixtures} $ echo  "require  'puppetlabs_spec_helper/ module_spec_helper'"  >  "spec/ spec_helper.rb" $ echo  "require  'puppetlabs_spec_helper/ rake_tasks'"  >  "Rakefile" Friday, February 1, 13
  • 31. Scaffolding $  cat  .fixtures.yml fixtures:    symlinks:        stdlib:  "#{source_dir}/../stdlib"        webapp:  "#{source_dir}" Friday, February 1, 13
  • 32. Testing yolo class  yolo  {    notic  {  'yolo':  } } require  'spec_helper' describe  'yolo'  do    it  "should  build"  do        should  contain_class('yolo')    end end Friday, February 1, 13
  • 33. Testing yolo rake  spec Failures:    1)  yolo  should  build          Failure/Error:  should  contain_class('yolo')          Puppet::Error:              Puppet::Parser::AST::Resource  failed  with   error  ArgumentError:  Invalid  resource  type  notic   at  yolo/manifests/init.pp:40   #  ./spec/classes/yolo_spec.rb:5 Finished  in  0.0809  seconds 1  example,  1  failure Friday, February 1, 13
  • 34. Fail fast class  yolo  (  $param  =  false,  ){    validate_string($param) } require  'spec_helper' describe  'yolo'  do    it  "should  build"  do        should  contain_class('yolo')    end end Friday, February 1, 13
  • 35. Fail fast rake  spec Failures:    1)  yolo  should  build          Failure/Error:  should  contain_class('yolo')          Puppet::Error:              false  is  not  a  string.    It  looks  to  be  a   FalseClass  at  yolo/manifests/init.pp:40 #  ./spec/classes/yolo_spec.rb:5 Finished  in  0.0809  seconds 1  example,  1  failure Friday, February 1, 13
  • 36. Fail more class  yolo  (  $param=false,  ){    validate_string($param)    if  empty($param){        fail(‘Dude,  wth,  empty?!’)    } } require  'spec_helper' describe  'yolo'  do let  :params  do  {  :param  =>  ''  }  end    [..] end Friday, February 1, 13
  • 37. Fail more rake  spec Failures:    1)  yolo  should  build          Failure/Error:  should  contain_class('yolo')          Puppet::Error:              Dude,  wth,  empty?!  at  yolo/manifests/ init.pp:43 #  ./spec/classes/yolo_spec.rb:5 Finished  in  0.0809  seconds 1  example,  1  failure Friday, February 1, 13
  • 38. Check your validation require  'spec_helper' describe  'yolo'  do    context  'with  invalid  $param  type'  do        let  :params  do  {  :param  =>  {}  }  end        it  "should  break  horribly"  do            expect  {  subject  }.to   raise_error(Puppet::Error,                          /{}  is  not  a  string/)        end    end end Friday, February 1, 13
  • 39. Check your validation rake  spec . Finished  in  0.08736  seconds 1  example,  0  failures Friday, February 1, 13
  • 40. Check your facts class  yolo(    $param  =  $yolo::params::lol )  inherits  yolo::params  {    [do  stuff,  like  validation] } Friday, February 1, 13
  • 41. Check your facts class  yolo::params  {    case  $::osfamily  {        'Debian':  {            [set  some  really  fancy  variables]        }        default:  {            fail("$osfamily  ${::osfamily}  is  not   supported  by  the  yolo  module.")        }    } } Friday, February 1, 13
  • 42. Check your facts    describe  'on  unsupported'  do        let  :facts  do            {  :osfamily  =>  'Little  Red  Riding  Hood'  }        end        it  'should  fail'  do            expect  {  subject  }.to  raise_error(/ osfamily  Little  Red  Riding  Hood  is  not   supported/)        end    end Friday, February 1, 13
  • 43. Check your resources class  yolo::configs  {    file  {  $f_yolo_default:        #  Template  uses  $interfaces        content  =>  template('yolo/default.erb'),    } } Friday, February 1, 13
  • 44. Check your resources describe  'yolo::configs'  do    let  :params  do        {  :f_yolo_default  =>  '/etc/default/yolo',}    end    it  do        should  contain_file('/etc/default   yolo').with_content(/CATS="lol"/)        end end Friday, February 1, 13
  • 45. Matchers • For every resource: contain_resource() • For every attribute: with_attr(‘value’) • Or: with({:attr1  =>  ‘value1’,  :attr2  =>   ‘value2’}) • Check the content:  with_content(regex) • include_class() Friday, February 1, 13
  • 46. Helpers • let  :params  do  {  :param  =>  {}  }  end • let  :facts  do  {  :osfamily  =>  ‘’  }  end • let  :pre_condition  do  'include   class::we::need'  end Friday, February 1, 13
  • 47. © Vinoth Chandar, http://www.flickr.com/photos/vinothchandar/4278047231/ Friday, February 1, 13