Your ultimate walkthrough Mastering puppets
Jun 18, 2015
Your ultimate walkthrough
Mastering puppets
Menu de jour
1. Intro2. Puppet overview3. Environment setup4. Implementation5. Review6. Happy end
Intro
• Why configuration provisioning?• Available solutions• Which one to select, why?• How to implement it?
Why configuration provisioning?
• It’s DRY• Law enforcement• Easier change management• Easier system scaling• Better mission control
Available solutions
• puppetlabs.com (Ruby)• cfengine.com (C)• quattor.org (Perl, Python)• opscode.com/chef (Ruby)• … and many others
Which one to select, why?
• Puppet– nicely designed– straightforward– Integrations with AWS, Openstack, …– backed by Google Ventures, Cisco,
Vmware– And it’s Ruby of course
How to implement it?
• Install prebuilt packages• Make it version controlled• Integrate with project management
tool
Puppet overview
• client/server software• They call it agent/master
Master directory structure
• /etc/puppet– /etc/puppet/puppet.conf– /etc/puppet/manifests– /etc/puppet/modules– /etc/puppet/autosign.conf
Agent configuration
• /etc/puppet/puppet.confserver=[hostname/ip]report=[true/false]runinterval=[n]s
Manifests syntax
class cms::sudo {
# # /etc/sudoers configuration file # file { '/etc/sudoers': source => 'puppet:///modules/cms/etc/sudoers', owner => 'root', group => 'root', mode => 440, } }
Manifests syntax vol. #2 service { 'apache2': ensure => running, enable => true, hasstatus => true, hasrestart => true, require => [ Mount['/mnt/www-data'], Mount['/mnt/archive'], File['/etc/apache2'], File['/opt/cache'], File['/tmp/huste'], File['/tmp/topstar'], File['/tmp/hcslovan'], File['/usr/local/lib/php5/php-cgi-wrapper'], ] }
Some resource types
• package• file• service• cron• mount• exec
Online docs
• Reference manualhttp://docs.puppetlabs.com/references/3.1.latest/
• Resource typeshttp://docs.puppetlabs.com/references/3.1.latest/type.html
Environment setup
• Groups of three• Sys admin (lead)• Web admin• Db admin
Implementation
• required packages: vim, tcpdump, mtr• Web server: apache2 + php (mod/cgi)• Mysql server: mysql5
Go ahead …
• Ask for help when needed
http://192.168.122.100/a.txthttp://192.168.122.100/b.txthttp://192.168.122.100/c.txt…
Review
Happy end
• Real-world implementation show off
Questions?