SlideShare ist ein Scribd-Unternehmen logo
1 von 30
Stanford
 Hackathon
 (D|N)an - Business Development
(d|n)an@puppetlabs.com | #puppet
       PuppetLabs - 2012
Overview
Overview
Puppet vs. Scripts
• Abstraction

• Idempotent

• Declarative
Abstraction
• Puppet packages:
  package { ‘sshd’:
    ensure => ‘present’,
  }


• Packages commands:
  yum/rpm
  apt/deb
  pkgadd/pkgutil
  gem
  ...
Idempotent
• Script:
  service sshd stop
  Stopping sshd:       [ OK ]
  service sshd stop
  Stopping sshd:       [FAILED]


• Puppet:
  puppet resource service sshd ensure=stopped ...
  notice: /Service[sshd]/ensure: ensure changed 'running' to
  'stopped'
  puppet resource service sshd ensure=stopped ...
Declarative
    Puppet internal                 Puppet user


    System state (is):           Desire state (should):

service sshd status           service { 'sshd':
                                ensure => running,
                              }




     system == desire

                         No
                                         noop?


                         No
      Remedy (sync):
                                        Report
service sshd start
Puppet Resource
• Puppet   manifest building block
 • file

 • user

 • package

 • service

 • ...
Puppet Resource
• puppet   resource <type> [title]
Puppet Manifests
•   package { ‘ssh’:
      ensure => ‘present’,
    }
    file { ‘/etc/sshd/sshd_config’:
      owner => ‘root’,
      group => ‘root’,
      mode => ‘0600’,
      source => ‘puppet:///modules/sshd/sshd_config’,
      require => Package[‘ssh’],
    }
    service { ‘sshd’:
      ensure => ‘running’,
      subscribe => File[‘/etc/sshd/ssd_config’],
    }
Puppet
              Organization
                       manifests                       package { 'sshd':
node lisa {                                              ensure => latest,
  class {lisa { { }
  node "ssh":            class ssh {                   }
}   class {lisa
    node "ssh": }          class ssh {
                           …
  } class { "ssh": }     } …
    }                      }                           file { 'sshd_config':
                                                         source => "puppet:///..."
        site.pp                                        }
                       files
                                                        native resource (ruby)
                         # sshd_config,v 1.81
                         # # sshd_config,v 1.81
                           This is the sshd server
                           # This is the sshd server
                         system-wide configuration
                           system-wide configuration    ssh::root_key {
                         …                               key => "AAAA…"
                           …
                                                       }

                                   ssh module          define resource (puppet)
Module
          Directories
• manifests:    puppet manifests
 (*.pp)
• files:   configuration file
• templates:    ERB template (*.erb)
• lib:   ruby (*.rb)
• tests:   puppet unit testing (*.pp)
Organization
Module
    Development
• Syntax   Check
• Unit   Test
• Acceptance    Test
• Environment    -> Deploy
Puppet Syntax
• puppet   parser validate
 • git   commit hook
 • vim   syntastic
 • geppetto   (eclipse IDE)
• puppet   best practice
 • puppet-lint
Unit Test
• puppet   cucumber
• rspec-puppet   (Tim Sharpe)
rspec-puppet
• verify   resources in catalog
• validate   different facts
• validate   different parameters
rspec-puppet
• rspec-puppet   directory
 structure:
• <module_name>/spec
   /classes
   /defines
   /fixtures
      /manifests/site.pp
rspec-puppet
•   #rspec_test/manifests/init.pp
    class rspec_test($message = ‘default’) {
       notify { $message: }
    }
•   #rspec_test/spec/rspec_test_spec.rb
    describe 'rspec_test' do
     describe 'with default parameters' do
      it { should contain_notify('default') }
     end
     describe 'when overriding message' do
      let :params do {:message => 'override'} end
      it { should contain_notify('override') }
     end
    end
Travis CI
• Github   integration
• Invoke   test on git push
• Simple   test matrix
.travis.yml
•   language: ruby
    before_script:
      - 'git clone git://github.com/puppetlabs/puppetlabs-
    stdlib.git spec/fixtures/modules/stdlib'
    rvm:
      - 1.8.7
      - 1.9.2
    script: "rake spec"
    env:
      - PUPPET_VERSION=2.6.12
      - PUPPET_VERSION=2.7.12
    matrix:
      exclude:
       - rvm: 1.9.2
         env: PUPPET_VERSION=2.6.12
Gemfile
•   source :rubygems

    puppetversion = ENV.key?('PUPPET_VERSION') ?
    "= #{ENV['PUPPET_VERSION']}" : ['>= 2.7']
    gem 'puppet', puppetversion 

    group :test do
     gem 'rake', '>= 0.9.0'
     gem 'rspec', '>= 2.8.0'
     gem 'rspec-puppet', '>= 0.1.1'
    end
Travis CI
Acceptance
       Testing
• vagrant   box
 • veewee    (basebox)
 • http://vagrantbox.es

• vagrant   init
• vagrant   up
• vagrant   provision
Vagrant
•   config.vm.provision :puppet do |puppet|
     puppet.manifests_path = "manifests"
     puppet.manifest_file = "oneiric.pp"
    end
•   config.vm.network :hostonly, "10.0.2.15"
•   config.vm.share_folder("v-root", "/vagrant", ".", :nfs
    => true)
Puppet Modules
• forge.puppetlabs.com

• www.github.com/puppetlabs

• Bring   your own module!
Module Projects?
• Module    cleanup
 • puppet-lint     (best practice)
• Module    test
 • rspec    puppet
 • travis   ci
• Module    development
Puppet Projects?
• Puppet issues:
 projects.puppetlabs.com
• Puppettools:
 geppeto
 puppet-lint
 rspec-puppet
We are hiring!
We are hiring!

Weitere ähnliche Inhalte

Was ist angesagt?

Replacing "exec" with a type and provider: Return manifests to a declarative ...
Replacing "exec" with a type and provider: Return manifests to a declarative ...Replacing "exec" with a type and provider: Return manifests to a declarative ...
Replacing "exec" with a type and provider: Return manifests to a declarative ...Puppet
 
Puppet Module Reusability - What I Learned from Shipping to the Forge
Puppet Module Reusability - What I Learned from Shipping to the ForgePuppet Module Reusability - What I Learned from Shipping to the Forge
Puppet Module Reusability - What I Learned from Shipping to the ForgePuppet
 
Introduction to ansible
Introduction to ansibleIntroduction to ansible
Introduction to ansibleOmid Vahdaty
 
Ansible Meetup Hamburg / Quickstart
Ansible Meetup Hamburg / QuickstartAnsible Meetup Hamburg / Quickstart
Ansible Meetup Hamburg / QuickstartHenry Stamerjohann
 
Writing and Publishing Puppet Modules - PuppetConf 2014
Writing and Publishing Puppet Modules - PuppetConf 2014Writing and Publishing Puppet Modules - PuppetConf 2014
Writing and Publishing Puppet Modules - PuppetConf 2014Puppet
 
DevOpsDaysCPT Ansible Infrastrucutre as Code 2017
DevOpsDaysCPT Ansible Infrastrucutre as Code 2017DevOpsDaysCPT Ansible Infrastrucutre as Code 2017
DevOpsDaysCPT Ansible Infrastrucutre as Code 2017Jumping Bean
 
Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015Alex S
 
Ansible, best practices
Ansible, best practicesAnsible, best practices
Ansible, best practicesBas Meijer
 
Automation with ansible
Automation with ansibleAutomation with ansible
Automation with ansibleKhizer Naeem
 
Ansible roles done right
Ansible roles done rightAnsible roles done right
Ansible roles done rightDan Vaida
 
Ansible for beginners ...?
Ansible for beginners ...?Ansible for beginners ...?
Ansible for beginners ...?shirou wakayama
 
Ansible loves Python, Python Philadelphia meetup
Ansible loves Python, Python Philadelphia meetupAnsible loves Python, Python Philadelphia meetup
Ansible loves Python, Python Philadelphia meetupGreg DeKoenigsberg
 
Best practices for ansible
Best practices for ansibleBest practices for ansible
Best practices for ansibleGeorge Shuklin
 
Node.js API 서버 성능 개선기
Node.js API 서버 성능 개선기Node.js API 서버 성능 개선기
Node.js API 서버 성능 개선기JeongHun Byeon
 

Was ist angesagt? (20)

Replacing "exec" with a type and provider: Return manifests to a declarative ...
Replacing "exec" with a type and provider: Return manifests to a declarative ...Replacing "exec" with a type and provider: Return manifests to a declarative ...
Replacing "exec" with a type and provider: Return manifests to a declarative ...
 
Puppet Module Reusability - What I Learned from Shipping to the Forge
Puppet Module Reusability - What I Learned from Shipping to the ForgePuppet Module Reusability - What I Learned from Shipping to the Forge
Puppet Module Reusability - What I Learned from Shipping to the Forge
 
Introduction to ansible
Introduction to ansibleIntroduction to ansible
Introduction to ansible
 
Ubic
UbicUbic
Ubic
 
Ansible Meetup Hamburg / Quickstart
Ansible Meetup Hamburg / QuickstartAnsible Meetup Hamburg / Quickstart
Ansible Meetup Hamburg / Quickstart
 
Writing and Publishing Puppet Modules - PuppetConf 2014
Writing and Publishing Puppet Modules - PuppetConf 2014Writing and Publishing Puppet Modules - PuppetConf 2014
Writing and Publishing Puppet Modules - PuppetConf 2014
 
Ansible - Introduction
Ansible - IntroductionAnsible - Introduction
Ansible - Introduction
 
DevOpsDaysCPT Ansible Infrastrucutre as Code 2017
DevOpsDaysCPT Ansible Infrastrucutre as Code 2017DevOpsDaysCPT Ansible Infrastrucutre as Code 2017
DevOpsDaysCPT Ansible Infrastrucutre as Code 2017
 
Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015
 
Ansible, best practices
Ansible, best practicesAnsible, best practices
Ansible, best practices
 
Automation with ansible
Automation with ansibleAutomation with ansible
Automation with ansible
 
Ansible roles done right
Ansible roles done rightAnsible roles done right
Ansible roles done right
 
Configuration Management in Ansible
Configuration Management in Ansible Configuration Management in Ansible
Configuration Management in Ansible
 
dotCloud and go
dotCloud and godotCloud and go
dotCloud and go
 
Ansible for beginners ...?
Ansible for beginners ...?Ansible for beginners ...?
Ansible for beginners ...?
 
Ansible loves Python, Python Philadelphia meetup
Ansible loves Python, Python Philadelphia meetupAnsible loves Python, Python Philadelphia meetup
Ansible loves Python, Python Philadelphia meetup
 
Play á la Rails
Play á la RailsPlay á la Rails
Play á la Rails
 
Best practices for ansible
Best practices for ansibleBest practices for ansible
Best practices for ansible
 
EC2
EC2EC2
EC2
 
Node.js API 서버 성능 개선기
Node.js API 서버 성능 개선기Node.js API 서버 성능 개선기
Node.js API 서버 성능 개선기
 

Andere mochten auch

Beginner's Thoughts on Making Puppet Modules - David Klann - PuppetCamp Chica...
Beginner's Thoughts on Making Puppet Modules - David Klann - PuppetCamp Chica...Beginner's Thoughts on Making Puppet Modules - David Klann - PuppetCamp Chica...
Beginner's Thoughts on Making Puppet Modules - David Klann - PuppetCamp Chica...Puppet
 
Config managament for development environments iii
Config managament for development environments iiiConfig managament for development environments iii
Config managament for development environments iiiPuppet
 
State of the Puppet Community (Jan 2013)
State of the Puppet Community (Jan 2013)State of the Puppet Community (Jan 2013)
State of the Puppet Community (Jan 2013)Puppet
 
PuppetConf at a glance
PuppetConf at a glancePuppetConf at a glance
PuppetConf at a glancePuppet
 
Automating Life in the Cloud - PuppetCamp Chicago '12
Automating Life in the Cloud - PuppetCamp Chicago '12Automating Life in the Cloud - PuppetCamp Chicago '12
Automating Life in the Cloud - PuppetCamp Chicago '12Puppet
 
It Automation: Doing it Wrong - Mykel Alvis
It Automation: Doing it Wrong - Mykel AlvisIt Automation: Doing it Wrong - Mykel Alvis
It Automation: Doing it Wrong - Mykel AlvisPuppet
 

Andere mochten auch (6)

Beginner's Thoughts on Making Puppet Modules - David Klann - PuppetCamp Chica...
Beginner's Thoughts on Making Puppet Modules - David Klann - PuppetCamp Chica...Beginner's Thoughts on Making Puppet Modules - David Klann - PuppetCamp Chica...
Beginner's Thoughts on Making Puppet Modules - David Klann - PuppetCamp Chica...
 
Config managament for development environments iii
Config managament for development environments iiiConfig managament for development environments iii
Config managament for development environments iii
 
State of the Puppet Community (Jan 2013)
State of the Puppet Community (Jan 2013)State of the Puppet Community (Jan 2013)
State of the Puppet Community (Jan 2013)
 
PuppetConf at a glance
PuppetConf at a glancePuppetConf at a glance
PuppetConf at a glance
 
Automating Life in the Cloud - PuppetCamp Chicago '12
Automating Life in the Cloud - PuppetCamp Chicago '12Automating Life in the Cloud - PuppetCamp Chicago '12
Automating Life in the Cloud - PuppetCamp Chicago '12
 
It Automation: Doing it Wrong - Mykel Alvis
It Automation: Doing it Wrong - Mykel AlvisIt Automation: Doing it Wrong - Mykel Alvis
It Automation: Doing it Wrong - Mykel Alvis
 

Ähnlich wie Stanford Hackathon - Puppet Modules

20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasaggarrett honeycutt
 
Puppet for Java developers - JavaZone NO 2012
Puppet for Java developers - JavaZone NO 2012Puppet for Java developers - JavaZone NO 2012
Puppet for Java developers - JavaZone NO 2012Carlos Sanchez
 
From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012Carlos Sanchez
 
Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013grim_radical
 
20100425 Configuration Management With Puppet Lfnw
20100425 Configuration Management With Puppet Lfnw20100425 Configuration Management With Puppet Lfnw
20100425 Configuration Management With Puppet Lfnwgarrett honeycutt
 
Puppet User Group Presentation - 15 March 2012
Puppet User Group Presentation - 15 March 2012Puppet User Group Presentation - 15 March 2012
Puppet User Group Presentation - 15 March 2012OlinData
 
Puppet User Group Presentation - 15 March 2012
Puppet User Group Presentation - 15 March 2012Puppet User Group Presentation - 15 March 2012
Puppet User Group Presentation - 15 March 2012Walter Heck
 
From Dev to DevOps - ApacheCON NA 2011
From Dev to DevOps - ApacheCON NA 2011From Dev to DevOps - ApacheCON NA 2011
From Dev to DevOps - ApacheCON NA 2011Carlos Sanchez
 
Introduction to InSpec and 1.0 release update
Introduction to InSpec and 1.0 release updateIntroduction to InSpec and 1.0 release update
Introduction to InSpec and 1.0 release updateAlex Pop
 
Puppet Camp Seattle 2014: Puppet: Cloud Infrastructure as Code
Puppet Camp Seattle 2014: Puppet: Cloud Infrastructure as CodePuppet Camp Seattle 2014: Puppet: Cloud Infrastructure as Code
Puppet Camp Seattle 2014: Puppet: Cloud Infrastructure as CodePuppet
 
OlinData Puppet Presentation for MOSC 2012
OlinData Puppet Presentation for MOSC 2012OlinData Puppet Presentation for MOSC 2012
OlinData Puppet Presentation for MOSC 2012OlinData
 
OlinData Puppet Presentation for MOSC 2012
OlinData Puppet Presentation for MOSC 2012OlinData Puppet Presentation for MOSC 2012
OlinData Puppet Presentation for MOSC 2012Walter Heck
 
From Dev to DevOps
From Dev to DevOpsFrom Dev to DevOps
From Dev to DevOpsAgile Spain
 
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Carlos Sanchez
 
How to Develop Puppet Modules: From Source to the Forge With Zero Clicks
How to Develop Puppet Modules: From Source to the Forge With Zero ClicksHow to Develop Puppet Modules: From Source to the Forge With Zero Clicks
How to Develop Puppet Modules: From Source to the Forge With Zero ClicksPuppet
 
Using Puppet on Linux, Windows, and Mac OSX
Using Puppet on Linux, Windows, and Mac OSXUsing Puppet on Linux, Windows, and Mac OSX
Using Puppet on Linux, Windows, and Mac OSXPuppet
 
InSpec Workshop at Velocity London 2018
InSpec Workshop at Velocity London 2018InSpec Workshop at Velocity London 2018
InSpec Workshop at Velocity London 2018Mandi Walls
 

Ähnlich wie Stanford Hackathon - Puppet Modules (20)

Puppet @ Seat
Puppet @ SeatPuppet @ Seat
Puppet @ Seat
 
20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag
 
Puppet for Java developers - JavaZone NO 2012
Puppet for Java developers - JavaZone NO 2012Puppet for Java developers - JavaZone NO 2012
Puppet for Java developers - JavaZone NO 2012
 
Puppet
PuppetPuppet
Puppet
 
From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012
 
Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013
 
20100425 Configuration Management With Puppet Lfnw
20100425 Configuration Management With Puppet Lfnw20100425 Configuration Management With Puppet Lfnw
20100425 Configuration Management With Puppet Lfnw
 
Puppet User Group Presentation - 15 March 2012
Puppet User Group Presentation - 15 March 2012Puppet User Group Presentation - 15 March 2012
Puppet User Group Presentation - 15 March 2012
 
Puppet User Group Presentation - 15 March 2012
Puppet User Group Presentation - 15 March 2012Puppet User Group Presentation - 15 March 2012
Puppet User Group Presentation - 15 March 2012
 
From Dev to DevOps - ApacheCON NA 2011
From Dev to DevOps - ApacheCON NA 2011From Dev to DevOps - ApacheCON NA 2011
From Dev to DevOps - ApacheCON NA 2011
 
Puppet
PuppetPuppet
Puppet
 
Introduction to InSpec and 1.0 release update
Introduction to InSpec and 1.0 release updateIntroduction to InSpec and 1.0 release update
Introduction to InSpec and 1.0 release update
 
Puppet Camp Seattle 2014: Puppet: Cloud Infrastructure as Code
Puppet Camp Seattle 2014: Puppet: Cloud Infrastructure as CodePuppet Camp Seattle 2014: Puppet: Cloud Infrastructure as Code
Puppet Camp Seattle 2014: Puppet: Cloud Infrastructure as Code
 
OlinData Puppet Presentation for MOSC 2012
OlinData Puppet Presentation for MOSC 2012OlinData Puppet Presentation for MOSC 2012
OlinData Puppet Presentation for MOSC 2012
 
OlinData Puppet Presentation for MOSC 2012
OlinData Puppet Presentation for MOSC 2012OlinData Puppet Presentation for MOSC 2012
OlinData Puppet Presentation for MOSC 2012
 
From Dev to DevOps
From Dev to DevOpsFrom Dev to DevOps
From Dev to DevOps
 
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
 
How to Develop Puppet Modules: From Source to the Forge With Zero Clicks
How to Develop Puppet Modules: From Source to the Forge With Zero ClicksHow to Develop Puppet Modules: From Source to the Forge With Zero Clicks
How to Develop Puppet Modules: From Source to the Forge With Zero Clicks
 
Using Puppet on Linux, Windows, and Mac OSX
Using Puppet on Linux, Windows, and Mac OSXUsing Puppet on Linux, Windows, and Mac OSX
Using Puppet on Linux, Windows, and Mac OSX
 
InSpec Workshop at Velocity London 2018
InSpec Workshop at Velocity London 2018InSpec Workshop at Velocity London 2018
InSpec Workshop at Velocity London 2018
 

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

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

Kürzlich hochgeladen

Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
"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
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 

Kürzlich hochgeladen (20)

Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"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...
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 

Stanford Hackathon - Puppet Modules

  • 1. Stanford Hackathon (D|N)an - Business Development (d|n)an@puppetlabs.com | #puppet PuppetLabs - 2012
  • 4. Puppet vs. Scripts • Abstraction • Idempotent • Declarative
  • 5. Abstraction • Puppet packages: package { ‘sshd’: ensure => ‘present’, } • Packages commands: yum/rpm apt/deb pkgadd/pkgutil gem ...
  • 6. Idempotent • Script: service sshd stop Stopping sshd: [ OK ] service sshd stop Stopping sshd: [FAILED] • Puppet: puppet resource service sshd ensure=stopped ... notice: /Service[sshd]/ensure: ensure changed 'running' to 'stopped' puppet resource service sshd ensure=stopped ...
  • 7. Declarative Puppet internal Puppet user System state (is): Desire state (should): service sshd status service { 'sshd': ensure => running, } system == desire No noop? No Remedy (sync): Report service sshd start
  • 8. Puppet Resource • Puppet manifest building block • file • user • package • service • ...
  • 9. Puppet Resource • puppet resource <type> [title]
  • 10. Puppet Manifests • package { ‘ssh’: ensure => ‘present’, } file { ‘/etc/sshd/sshd_config’: owner => ‘root’, group => ‘root’, mode => ‘0600’, source => ‘puppet:///modules/sshd/sshd_config’, require => Package[‘ssh’], } service { ‘sshd’: ensure => ‘running’, subscribe => File[‘/etc/sshd/ssd_config’], }
  • 11. Puppet Organization manifests package { 'sshd': node lisa { ensure => latest, class {lisa { { } node "ssh": class ssh { } } class {lisa node "ssh": } class ssh { … } class { "ssh": } } … } } file { 'sshd_config': source => "puppet:///..." site.pp } files native resource (ruby) # sshd_config,v 1.81 # # sshd_config,v 1.81 This is the sshd server # This is the sshd server system-wide configuration system-wide configuration ssh::root_key { … key => "AAAA…" … } ssh module define resource (puppet)
  • 12. Module Directories • manifests: puppet manifests (*.pp) • files: configuration file • templates: ERB template (*.erb) • lib: ruby (*.rb) • tests: puppet unit testing (*.pp)
  • 14. Module Development • Syntax Check • Unit Test • Acceptance Test • Environment -> Deploy
  • 15. Puppet Syntax • puppet parser validate • git commit hook • vim syntastic • geppetto (eclipse IDE) • puppet best practice • puppet-lint
  • 16. Unit Test • puppet cucumber • rspec-puppet (Tim Sharpe)
  • 17. rspec-puppet • verify resources in catalog • validate different facts • validate different parameters
  • 18. rspec-puppet • rspec-puppet directory structure: • <module_name>/spec /classes /defines /fixtures /manifests/site.pp
  • 19. rspec-puppet • #rspec_test/manifests/init.pp class rspec_test($message = ‘default’) { notify { $message: } } • #rspec_test/spec/rspec_test_spec.rb describe 'rspec_test' do describe 'with default parameters' do it { should contain_notify('default') } end describe 'when overriding message' do let :params do {:message => 'override'} end it { should contain_notify('override') } end end
  • 20. Travis CI • Github integration • Invoke test on git push • Simple test matrix
  • 21. .travis.yml • language: ruby before_script: - 'git clone git://github.com/puppetlabs/puppetlabs- stdlib.git spec/fixtures/modules/stdlib' rvm: - 1.8.7 - 1.9.2 script: "rake spec" env: - PUPPET_VERSION=2.6.12 - PUPPET_VERSION=2.7.12 matrix: exclude: - rvm: 1.9.2 env: PUPPET_VERSION=2.6.12
  • 22. Gemfile • source :rubygems puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>= 2.7'] gem 'puppet', puppetversion  group :test do gem 'rake', '>= 0.9.0' gem 'rspec', '>= 2.8.0' gem 'rspec-puppet', '>= 0.1.1' end
  • 24. Acceptance Testing • vagrant box • veewee (basebox) • http://vagrantbox.es • vagrant init • vagrant up • vagrant provision
  • 25. Vagrant • config.vm.provision :puppet do |puppet| puppet.manifests_path = "manifests" puppet.manifest_file = "oneiric.pp" end • config.vm.network :hostonly, "10.0.2.15" • config.vm.share_folder("v-root", "/vagrant", ".", :nfs => true)
  • 26. Puppet Modules • forge.puppetlabs.com • www.github.com/puppetlabs • Bring your own module!
  • 27. Module Projects? • Module cleanup • puppet-lint (best practice) • Module test • rspec puppet • travis ci • Module development
  • 28. Puppet Projects? • Puppet issues: projects.puppetlabs.com • Puppettools: geppeto puppet-lint rspec-puppet

Hinweis der Redaktion

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n