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 loyalty
digbyj
 
brochure_Ageneric_web
brochure_Ageneric_webbrochure_Ageneric_web
brochure_Ageneric_web
Talat Erden
 
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
UserZoom
 

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

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
 
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
Joel Byler
 
GitHub Notable OSS Project
GitHub  Notable OSS ProjectGitHub  Notable OSS Project
GitHub Notable OSS Project
roumia
 

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 controlrepo
Puppet
 
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
 
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
Puppet
 

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

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
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
panagenda
 

Recently uploaded (20)

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
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
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
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
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...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
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
 
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
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 

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