Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introduction to Puppet

Introduction to Puppet

I talk i gave as in introduction to puppet

Avatar for Stephen Johnson

Stephen Johnson

March 20, 2013
Tweet

More Decks by Stephen Johnson

Other Decks in Technology

Transcript

  1. The 3 Things • Laziness • Impatience • Hubris Three

    Great Virtues of a Programmer (or Sysadmin) — Larry Wall Wednesday, 20 March 13
  2. Laziness • Is a good thing • Automate, Automate, Automate

    • Remove the boring jobs • I dont want to do that myself Wednesday, 20 March 13
  3. Impatience • I want it done now • Why do

    we have to take x to build y machine • I dont care about how its done, just get it done Wednesday, 20 March 13
  4. Hubris • You want to look awesome • You want

    your infrastructure to be cooler Wednesday, 20 March 13
  5. What not to do • Custom script ( The guy

    left) • Gold image ( List of post clone stuff) • Manual ( Arrr you kidding ) • Massive RPM of doom ( The guy left) Wednesday, 20 March 13
  6. What you need to do • Remove the snow flake

    machines • Stop the, ‘i changed that config’ • Cookie cutter machines • Dont care about them anymore Wednesday, 20 March 13
  7. Puppet gets you Knowledge • Version controlled infrastructure • Convergence

    ( Get back in line MOFO ) • Reporting • Query-ability • AKA AWESOMENESS • Removing the WTF / FAIL Wednesday, 20 March 13
  8. Automate • Ntp config • Apache config • Mysql config

    • Syslog config • AKA EVERYTHING Wednesday, 20 March 13
  9. But how class sysadmins { user { 'elmo': ensure =>

    present, gid => 'sysadmin', home => '/home/sysadmins/elmo', } group { 'sysadmin': ensure => present, } } Wednesday, 20 March 13
  10. Wait there is more node  webserver  {      

     @@file  {  "/etc/nagios/conf.d/$::{fqdn}.apachecheck.conf":              content  =>  "nagios  check  stuff  \n",              tag  =>  "nagioscheck",            } } node  nagiosmachine  {        File  <<|  tag  ==  'nagioscheck'  |>> } Wednesday, 20 March 13
  11. How does that work • Puppetdb • Stores configs •

    Scalable • AWESOMENESS Wednesday, 20 March 13
  12. The data problem • Puppet modules without hard-coded data are

    easily shared and more re-usable • Infrastructure configuration can be managed without needing to edit Puppet code Wednesday, 20 March 13
  13. Example if ( $::environment == ‘dev’ ) { $ntpserver =

    ‘192.168.2.1’ } else { if ( $::fqdn == ‘host4.mycorp.com’) { $ntpserver = ‘127.0.0.1’ } else { $ntpserver = ‘213.21.6.4’ } } Wednesday, 20 March 13
  14. Remove Data from Code • Hiera uses information to determine

    a hierarchy • Top down hierarchy for overriding configuration values based on roles, environments, locations.... or anything else • And do this without any coding! Wednesday, 20 March 13
  15. Puppet 3.0 • Hiera is integrated into the core product

    • Introduces data mapping for parameterized classes • Backwards compatible Wednesday, 20 March 13