Puppet

 Puppet

Puppet

C30278aff55d97404321e3742f356ee3?s=128

Salimane Adjao Moustapha

August 14, 2013
Tweet

Transcript

  1. Puppet Salimane Adjao Moustapha Salimane.moustapha@meltwater.com salimane.com

  2. • Web app depends on services that should be on

    the server, users access/permissions... • Capistrano expects folders, rvm to be in a certain location • You need to deploy many servers with different environments on staging, production... • Doing all that manually and you're setting yourself for “wtf!wtf! wtf!”...
  3. The idea is to make it repeatable, predictable and testable

    with less moving parts...
  4. Insert Puppet... • Configuration management framework and tools • Ruby

    based • GPLv2/Apache licenses • From PuppetLabs (company)
  5. • Deployment • Config Language and Resource Abstraction • Transactional

    Layer
  6. Deployment • Master – Run as daemon – Listen on

    a port – Serve configuration catalogs • Agent – Connect to master via ssh – Retrieve configuration catalog from master – Can run as a daemon or manually triggered • Puppet can also run in stand alone mode
  7. Config language/ Resource Abstraction file { ['/meltwater', '/meltwater/likealyzer']: ensure =>

    directory, owner => 'www-data', group => 'www-data', mode => '0644', require => User['www-data'], }
  8. Transactional layer • Agent uses facter to get details about

    itself • Agent send “facts” to Master • Master recognize, compile configuration “catalog” for that agent and send it back • Agent apply the “catalog” on itself then send a result report back
  9. Configuration • Node Definition • Resource Definition • Module Definition

    • ...
  10. Node definition node puppet-demo { file { ['/meltwater', '/meltwater/likealyzer']: ensure

    => directory, owner => 'vagrant', group => 'vagrant', mode => '0644' } }
  11. Resource Definition type { name: attribute => value, } package

    { 'vim': ensure => present }
  12. Module Definition • mymodule – files – templates – tests

    – spec • spec_helper.rb – manifests • init.pp
  13. Demo time

  14. Questions