SlideShare a Scribd company logo
Puppet
Client – Server Model




  Configuration management
  Unix-like and Windows
  Discover by Facter and send to agent
Procedural vs. Declarative
How vs. What
Shell vs. Puppet

     package { "vim":
       ensure => present,
     }
Nodes Manifest and Modules

 node /^wwwd+.example.com/ {
     include sudo
 }

 node jira-dev.researchnow.com/ {
     include sudo
 }
 …
--noop



  $ puppet agent –test --noop
It’s own DSL…if/else, etc.

package { "ssh":
      name => $operatingsystem ?
      /(Red Hat|CentOS|Fedora|Ubuntu|Debian)/ =>
            "openssh-server",
      Solaris => "openssh",
      },
      ensure => installed,
}



      My recommendation: RTFB …. Read The Fowler Book on DSL
Audit

file { '/etc/hosts':
      audit => [ owner, group, mode ],
}

audit change: previously recorded value owner root
has been changed to owner daemon
Environments, Dev/QA…or Per
contributor




 $ puppet agent –test –v –-environemnt testing
Scaling
• Default puppet master is using webrick
• You can host it on apache
Externalizing Puppet Configuration
• ENC – External Node Classification
• LDAP server classification
• Database
• Ruby script or Perl
• Dashboard
• Foreman
Foreman
TDD - rspec
require 'spec_helper'

describe 'logrotate::rule' do
  let(:title) { 'nginx' }

 it { should include_class('logrotate::rule') }

 it do
   should contain_file('/etc/logrotate.d/nginx').with({
      'ensure' => 'present',
      'owner' => 'root',
      'group' => 'root',
      'mode'   => '0444',
   })
 end

 context 'with compress => true' do
   let(:params) { {:compress => true} }

   it do
     should contain_file('/etc/logrotate.d/nginx') 
       .with_content(/^s*compress$/)
   end
 end

 context 'with compress => false' do
   let(:params) { {:compress => false} }
TDD - cucumber
Feature: General catalog policy
  In order to ensure applicability of a host's catalog
  As a manifest developer
  I want all catalogs to obey some general rules

 Scenario Outline: Compile and verify catalog
   Given a node specified by "features/yaml/<hostname>.example.com.yaml"
   When I compile its catalog
   Then compilation should succeed
   And all resource dependencies should resolve

   Examples:
     | hostname |
     | localhost |
Tips
•   # install latest puppet
•   wget http://apt.puppetlabs.com/puppetlabs-release-precise.deb
•   sudo dpkg -i puppetlabs-release-precise.deb
•   sudo apt-get update sudo apt-get install puppetmaster

•   # chaining
•   # ntp.conf is applied first, and will notify the ntpd service
•   # if it changes:
•   File['/etc/ntp.conf'] ~> Service['ntpd']

•   # Certification tips
•   puppet cert clean liferay-dev.local
•   rm -f /var/lib/puppet/ssl/certs/liferay-dev.local.pem
•   find /var/lib/puppet -type f -print0 |xargs -0r rm

•   # Debug
•   puppet master   --no-daemonize --debug --verbose –trace
•   puppet config   print manifest
•   puppet config   print all
•   puppet config   print modulepath
What do we have so far?


     https://github.com/rsn-innovation/puppets

More Related Content

PDF
Ansible - Swiss Army Knife Orchestration
PPTX
Ansible fest Presentation slides
PPTX
Introduction to Ansible
PDF
Vagrant + Rouster at salesforce.com - PuppetConf 2013
PDF
Fabric workshop(1) - (MOSG)
PDF
More tips n tricks
PDF
Using Ansible for Deploying to Cloud Environments
PDF
Test driven infrastructure
Ansible - Swiss Army Knife Orchestration
Ansible fest Presentation slides
Introduction to Ansible
Vagrant + Rouster at salesforce.com - PuppetConf 2013
Fabric workshop(1) - (MOSG)
More tips n tricks
Using Ansible for Deploying to Cloud Environments
Test driven infrastructure

What's hot (20)

PPTX
Introduction to ansible
PDF
DevOps(3) : Ansible - (MOSG)
PDF
Ansible - Introduction
PPTX
Using Ansible Dynamic Inventory with Amazon EC2
PDF
DevOps(2) : Vagrant - (MOSG)
PPTX
Capistrano - automate all the things
PPTX
Getting Started with Capistrano
PDF
Network Automation: Ansible 102
PDF
Bangpypers april-meetup-2012
PDF
Using Puppet to Create a Dynamic Network - PuppetConf 2013
PPTX
Ansible 101, Gennadiy Mykhailiuta
PDF
Testing your infrastructure with litmus
PDF
DevOps(4) : Ansible(2) - (MOSG)
PDF
Ansible tips & tricks
PDF
Puppet fundamentals
PPT
Capistrano
PDF
Beaker: Automated, Cloud-Based Acceptance Testing - PuppetConf 2014
PDF
Instruction: dev environment
PDF
Securing Prometheus exporters using HashiCorp Vault
PPTX
DevOps with Fabric
Introduction to ansible
DevOps(3) : Ansible - (MOSG)
Ansible - Introduction
Using Ansible Dynamic Inventory with Amazon EC2
DevOps(2) : Vagrant - (MOSG)
Capistrano - automate all the things
Getting Started with Capistrano
Network Automation: Ansible 102
Bangpypers april-meetup-2012
Using Puppet to Create a Dynamic Network - PuppetConf 2013
Ansible 101, Gennadiy Mykhailiuta
Testing your infrastructure with litmus
DevOps(4) : Ansible(2) - (MOSG)
Ansible tips & tricks
Puppet fundamentals
Capistrano
Beaker: Automated, Cloud-Based Acceptance Testing - PuppetConf 2014
Instruction: dev environment
Securing Prometheus exporters using HashiCorp Vault
DevOps with Fabric
Ad

Viewers also liked (8)

PPTX
Introduction to Automated Deployments with Ansible
PDF
Agile Deployments with Puppet
PDF
Introduction to Infrastructure as Code & Automation / Introduction to Chef
PDF
Puppet & Jenkins
PPTX
Deploying Symfony2 app with Ansible
PPTX
Continuous Development with Jenkins - Stephen Connolly at PuppetCamp Dublin '12
PDF
CAPS: What's best for deploying and managing OpenStack? Chef vs. Ansible vs. ...
PPTX
Test-Driven Infrastructure with Ansible, Test Kitchen, Serverspec and RSpec
Introduction to Automated Deployments with Ansible
Agile Deployments with Puppet
Introduction to Infrastructure as Code & Automation / Introduction to Chef
Puppet & Jenkins
Deploying Symfony2 app with Ansible
Continuous Development with Jenkins - Stephen Connolly at PuppetCamp Dublin '12
CAPS: What's best for deploying and managing OpenStack? Chef vs. Ansible vs. ...
Test-Driven Infrastructure with Ansible, Test Kitchen, Serverspec and RSpec
Ad

Similar to Puppet (20)

PDF
Systems Automation with Puppet
PDF
Writing and Publishing Puppet Modules - PuppetConf 2014
PDF
20090514 Introducing Puppet To Sasag
PDF
PuppetCamp SEA 1 - Puppet Deployment at OnApp
PDF
Puppet Deployment at OnApp
PDF
PuppetCamp SEA 1 - Puppet Deployment at OnApp
PDF
Creating a mature puppet system
PDF
Creating a Mature Puppet System
PDF
Intro to-puppet
PDF
Orchestrated Functional Testing with Puppet-spec and Mspectator
PDF
Orchestrated Functional Testing with Puppet-spec and Mspectator - PuppetConf ...
PDF
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
KEY
Puppet for Java developers - JavaZone NO 2012
PPTX
Learning Puppet basic thing
PDF
ContainerCon - Test Driven Infrastructure
PDF
Developing IT infrastructures with Puppet
PPS
A Presentation about Puppet that I've made at the OSSPAC conference
PPTX
Troubleshooting Puppet
PPTX
Puppet Troubleshooting
PPTX
Puppet meetup testing
Systems Automation with Puppet
Writing and Publishing Puppet Modules - PuppetConf 2014
20090514 Introducing Puppet To Sasag
PuppetCamp SEA 1 - Puppet Deployment at OnApp
Puppet Deployment at OnApp
PuppetCamp SEA 1 - Puppet Deployment at OnApp
Creating a mature puppet system
Creating a Mature Puppet System
Intro to-puppet
Orchestrated Functional Testing with Puppet-spec and Mspectator
Orchestrated Functional Testing with Puppet-spec and Mspectator - PuppetConf ...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Puppet for Java developers - JavaZone NO 2012
Learning Puppet basic thing
ContainerCon - Test Driven Infrastructure
Developing IT infrastructures with Puppet
A Presentation about Puppet that I've made at the OSSPAC conference
Troubleshooting Puppet
Puppet Troubleshooting
Puppet meetup testing

Puppet

  • 2. Client – Server Model Configuration management Unix-like and Windows Discover by Facter and send to agent
  • 3. Procedural vs. Declarative How vs. What Shell vs. Puppet package { "vim": ensure => present, }
  • 4. Nodes Manifest and Modules node /^wwwd+.example.com/ { include sudo } node jira-dev.researchnow.com/ { include sudo } …
  • 5. --noop $ puppet agent –test --noop
  • 6. It’s own DSL…if/else, etc. package { "ssh": name => $operatingsystem ? /(Red Hat|CentOS|Fedora|Ubuntu|Debian)/ => "openssh-server", Solaris => "openssh", }, ensure => installed, } My recommendation: RTFB …. Read The Fowler Book on DSL
  • 7. Audit file { '/etc/hosts': audit => [ owner, group, mode ], } audit change: previously recorded value owner root has been changed to owner daemon
  • 8. Environments, Dev/QA…or Per contributor $ puppet agent –test –v –-environemnt testing
  • 9. Scaling • Default puppet master is using webrick • You can host it on apache
  • 10. Externalizing Puppet Configuration • ENC – External Node Classification • LDAP server classification • Database • Ruby script or Perl • Dashboard • Foreman
  • 12. TDD - rspec require 'spec_helper' describe 'logrotate::rule' do let(:title) { 'nginx' } it { should include_class('logrotate::rule') } it do should contain_file('/etc/logrotate.d/nginx').with({ 'ensure' => 'present', 'owner' => 'root', 'group' => 'root', 'mode' => '0444', }) end context 'with compress => true' do let(:params) { {:compress => true} } it do should contain_file('/etc/logrotate.d/nginx') .with_content(/^s*compress$/) end end context 'with compress => false' do let(:params) { {:compress => false} }
  • 13. TDD - cucumber Feature: General catalog policy In order to ensure applicability of a host's catalog As a manifest developer I want all catalogs to obey some general rules Scenario Outline: Compile and verify catalog Given a node specified by "features/yaml/<hostname>.example.com.yaml" When I compile its catalog Then compilation should succeed And all resource dependencies should resolve Examples: | hostname | | localhost |
  • 14. Tips • # install latest puppet • wget http://apt.puppetlabs.com/puppetlabs-release-precise.deb • sudo dpkg -i puppetlabs-release-precise.deb • sudo apt-get update sudo apt-get install puppetmaster • # chaining • # ntp.conf is applied first, and will notify the ntpd service • # if it changes: • File['/etc/ntp.conf'] ~> Service['ntpd'] • # Certification tips • puppet cert clean liferay-dev.local • rm -f /var/lib/puppet/ssl/certs/liferay-dev.local.pem • find /var/lib/puppet -type f -print0 |xargs -0r rm • # Debug • puppet master --no-daemonize --debug --verbose –trace • puppet config print manifest • puppet config print all • puppet config print modulepath
  • 15. What do we have so far? https://github.com/rsn-innovation/puppets