Top Banner
http://joind.in/6328 Puppet for Dummies 4developers - 18 april 2012 Poznań - Poland woensdag 18 april 12
84

Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

Jun 28, 2018

Download

Documents

dangnhu
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

http://joind.in/6328

Puppet forDummies4developers - 18 april 2012Poznań - Poland

woensdag 18 april 12

Page 2: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

Joshua Thijssen

Freelance consultant, developer and trainer @ NoxLogic / Techademy

Development in PHP, Python, Perl, C, Java and some sysadmin

Blog: http://adayinthelifeof.nl

Email: [email protected]: @jaytaph

oh hai!

2

woensdag 18 april 12

Page 3: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

3

woensdag 18 april 12

Page 4: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

What is puppet and why should I care?

3

woensdag 18 april 12

Page 5: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

What is puppet and why should I care?

3

(answer: it’s cool and because I told you so)

woensdag 18 april 12

Page 6: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

“People are finally figuring out puppet and how it gets you to the pub by 4pm.

Note that I’ve been at this pub since 2pm.”

- Jorge Castro

4

woensdag 18 april 12

Page 7: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

5

woensdag 18 april 12

Page 8: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

Puppet is a (not necessarily the) solution for the following problem:

How do we setup, manage, synchronize, and upgrade our internal and external

infrastructure?

6

woensdag 18 april 12

Page 9: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

Sysadmin! Y U no fix problem!

7

woensdag 18 april 12

Page 10: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

Sysadmin! Y U no fix problem!

NO

7

woensdag 18 april 12

Page 11: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

LAMP-stack

8

woensdag 18 april 12

Page 12: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

LAMP-stack

Linux

Apache

MySQL

PHP

8

woensdag 18 april 12

Page 13: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

LAMPGMVNMCSTRAH-stack

9

woensdag 18 april 12

Page 14: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

LAMPGMVNMCSTRAH-stack

Linux

Apache

MySQL

PHP

Gearman

MongoDB

CouchDBSolr

Tika

Redis

ActiveMQHadoop

Varnish

Ngnix

Memcache

9

woensdag 18 april 12

Page 15: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

10

woensdag 18 april 12

Page 16: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

10

How do we control our infrastructure?

woensdag 18 april 12

Page 17: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

➡ Solution 1: We don’t,

10

How do we control our infrastructure?

woensdag 18 april 12

Page 18: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

➡ Solution 1: We don’t,

➡ Solution 2: We outsource,

10

How do we control our infrastructure?

woensdag 18 april 12

Page 19: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

➡ Solution 1: We don’t,

➡ Solution 2: We outsource,

➡ Solution 3: We automate the process.

10

How do we control our infrastructure?

woensdag 18 april 12

Page 20: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

‣ Solution 1: we don’t11

woensdag 18 april 12

Page 21: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

➡ It’s not funny: you find it more often than not. Especially inside small development companies.

‣ Solution 1: we don’t11

woensdag 18 april 12

Page 22: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

➡ It’s not funny: you find it more often than not. Especially inside small development companies.

➡ Internal sysadmin, but he’s too busy with development to do sysadmin.

‣ Solution 1: we don’t11

woensdag 18 april 12

Page 23: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

➡ It’s not funny: you find it more often than not. Especially inside small development companies.

➡ Internal sysadmin, but he’s too busy with development to do sysadmin.

➡ We only act on escalation

‣ Solution 1: we don’t11

woensdag 18 april 12

Page 24: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

➡ It’s not funny: you find it more often than not. Especially inside small development companies.

➡ Internal sysadmin, but he’s too busy with development to do sysadmin.

➡ We only act on escalation

➡ reactive, not proactive

‣ Solution 1: we don’t11

woensdag 18 april 12

Page 25: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

‣ Solution 2: we outsource12

woensdag 18 april 12

Page 26: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

➡ Expensive $LA’s.

‣ Solution 2: we outsource12

woensdag 18 april 12

Page 27: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

➡ Expensive $LA’s.

➡ What about INTERNAL servers like your development systems and infrastructure?

‣ Solution 2: we outsource12

woensdag 18 april 12

Page 28: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

➡ Expensive $LA’s.

➡ What about INTERNAL servers like your development systems and infrastructure?

➡ Fight between stability and agility.

‣ Solution 2: we outsource12

woensdag 18 april 12

Page 29: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

➡ Expensive $LA’s.

➡ What about INTERNAL servers like your development systems and infrastructure?

➡ Fight between stability and agility.

➡ Does your hosting company decide on whether you can use PHP5.3???

‣ Solution 2: we outsource12

woensdag 18 april 12

Page 30: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

‣ Solution 3: we do it ourselves and automate13

woensdag 18 april 12

Page 31: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

➡ We are in charge.

‣ Solution 3: we do it ourselves and automate13

woensdag 18 april 12

Page 32: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

➡ We are in charge.

➡ You can do what you like

‣ Solution 3: we do it ourselves and automate13

woensdag 18 april 12

Page 33: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

➡ We are in charge.

➡ You can do what you like

➡ Use: cfEngine, chef, puppet.

‣ Solution 3: we do it ourselves and automate13

woensdag 18 april 12

Page 34: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

➡ We are in charge.

➡ You can do what you like

➡ Use: cfEngine, chef, puppet.

➡ When done right, maintenance should not be difficult.

‣ Solution 3: we do it ourselves and automate13

woensdag 18 april 12

Page 35: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

PUPPET

14

woensdag 18 april 12

Page 36: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

➡ Open source configuration management tool.

➡ Written in Ruby

➡ Open source: https://github.com/puppetlabs

➡ Commercial version available (puppet enterprise)

15

woensdag 18 april 12

Page 37: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

➡ Don’t tell HOW to do stuff.

➡ Tell WHAT to do.

¹

¹ It’s not actually true, but good enough for now...16

woensdag 18 april 12

Page 38: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

➡ Don’t tell HOW to do stuff.

➡ Tell WHAT to do.

¹

¹ It’s not actually true, but good enough for now...

“yum install httpd”“apt-get install apache2”

“install and run the apache webserver”

16

woensdag 18 april 12

Page 39: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

17

Schematic representation of a puppet infrastructure

woensdag 18 april 12

Page 40: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

Puppet

17

Schematic representation of a puppet infrastructure

woensdag 18 april 12

Page 41: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

Puppet CA PuppetMaster

PuppetAgent

https

18

woensdag 18 april 12

Page 42: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

Puppet CA PuppetMaster

PuppetAgent

PuppetAgent

PuppetAgent

https

18

woensdag 18 april 12

Page 43: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

Puppetmaster

Puppetclient

19

woensdag 18 april 12

Page 44: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

Puppetmaster

Puppetclient

Check credentials

19

woensdag 18 april 12

Page 45: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

Puppetmaster

Puppetclient

Check credentials

Send facts

19

woensdag 18 april 12

Page 46: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

Puppetmaster

Puppetclient

Check credentials

Send facts

Returns “catalog”

19

woensdag 18 april 12

Page 47: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

Puppetmaster

Puppetclient

Check credentials

Send facts

Returns “catalog”

Report results

19

woensdag 18 april 12

Page 48: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

➡ Catalogs are “compiled” manifests

➡ Manifests are puppet definitions

➡ <filename>.pp

➡ Puppet DSL

➡ De-cla-ra-tive language

➡ Version your manifests! (git/svn)

20

woensdag 18 april 12

Page 49: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

package { “strace” : ensure => present,}

file { “/home/jaytaph/secret-ingredient.txt” : ensure => present, mode => 0600, user => ‘jaytaph’, group => ‘noxlogic’, content => “beer”, }

21

woensdag 18 april 12

Page 50: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

package { “httpd” : ensure => present,}

service { “httpd”: running => true, enable => true, }

22

woensdag 18 april 12

Page 51: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

package { “httpd” : ensure => present,}

service { “httpd”: running => true, enable => true, } require => Package[“httpd”],

22

woensdag 18 april 12

Page 52: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

‣ Different distributions, different names

Centos / Redhatservice: httpdpackage: httpdconfig: /etc/httpd/conf/httpd.confvhosts: /etc/httpd/conf.d/*.conf

Debian / Ubuntuservice: apache2package: apache2config: /etc/apache2/httpd.confvhosts: /etc/apache2/sites-available

23

woensdag 18 april 12

Page 53: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

$operatingsystem is a FACT

package { “webserver”: case $operatingsystem { centos, redhat { $apache = “httpd” } debian, ubuntu { $apache = “apache2” } default : { fail(‘I don’t know this OS/distro’) } }

name => $apache, ensure => installed,

}

24

woensdag 18 april 12

Page 54: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

[root@puppetnode1 ~]# facter --puppetarchitecture => x86_64fqdn => puppetnode1.noxlogic.localinterfaces => eth1,eth2,loipaddress_eth1 => 192.168.1.114ipaddress_eth2 => 192.168.56.200kernel => Linuxkernelmajversion => 2.6operatingsystem => CentOSoperatingsystemrelease => 6.0processor0 => Intel(R) Core(TM)2 Duo CPU T7500 @ 2.20GHzpuppetversion => 2.6.9

‣ A simple list with info (also useable in your own tools)25

woensdag 18 april 12

Page 55: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

node default { $def_packages = [ “mc”, “strace”, “sysstat” ] package { $def_packages : ensure => latest, }}

/etc/puppet/manifests/site.pp:

‣ “Main” manifest26

woensdag 18 april 12

Page 56: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

Defining nodes - regular expressions

node /^web\d+\.example\.local$/ { package { “httpd” : ensure => latest, }}node /^db\d+\.example\.local$/ { package { “mysql-server” : ensure => installed, }}

27

woensdag 18 april 12

Page 57: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

node basenode { user { “jaytaph” : ensure => present, gid => 1000, uid => 1000, home => “/home/jaytaph”, shell => “/bin/sh”, password => “supersecrethashedpassword”, managehome => true, }}node /^.+\.example\.local/ inherits basenode { ...}

‣ Node inheritance28

woensdag 18 april 12

Page 58: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

‣ Group together into a class29

woensdag 18 april 12

Page 59: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

class webserver { service { “apache”: ensure => running, require => Package[“apache”],

} package { “apache” : ensure => installed, }

}

‣ Group together into a class29

woensdag 18 april 12

Page 60: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

class webserver { service { “apache”: ensure => running, require => Package[“apache”],

} package { “apache” : ensure => installed, }

}

file { “vhost_${webserver_name}” : path => “/etc/httpd/conf/10-vhost.conf”, content => template(“vhost.template.erb”), notify => Service[“httpd”], }

‣ Group together into a class29

woensdag 18 april 12

Page 61: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

<virtualHost <%= ipaddress %>:80> ServerName <%= webserver_name %> ServerAlias <%= webserver_alias %> DocumentRoot <%= webserver_docroot %>

</virtualHost>

vhost.template.erb

30‣ ERB templates can contain custom variables and facts

woensdag 18 april 12

Page 62: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

node “web01.example.local” inherits base { $webserver_name = “web01.example.local” $webserver_alias = “www.example.local” $webserver_docroot = “/var/www/web01” include webserver}node “web02.example.local” inherits base { $webserver_name = “web02.example.local” $webserver_alias = “crm.example.local” $webserver_docroot = “/var/www/web02” include webserver}

31

woensdag 18 april 12

Page 63: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

➡ A puppet module is a collection of resources, classes, templates.

➡ Used for easy distribution and code-reuse.

➡ Self-contained, run out-of-the-box

32

woensdag 18 april 12

Page 64: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

➡ puppetforge / github

➡ Create your own (and share!).

➡ Use the ones from puppet enterprise edition.

➡ Use the standard layout / best practices

33

woensdag 18 april 12

Page 65: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

class ntp::install { package{"ntpd": ensure => latest }}class ntp::config { File{ require => Class["ntp::install"], notify => Class["ntp::service"], owner => "root", group => "root", mode => 644 } file{"/etc/ntp.conf": source => "puppet:///ntp/ntp.conf"; "/etc/ntp/step-tickers": source => "puppet:///ntp/step-tickers"; }}class ntp::service { service{"ntp": ensure => running, enable => true, require => Class["ntp::config"], }}class ntp { include ntp::install, ntp::config, ntp::service}

34

woensdag 18 april 12

Page 66: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

➡ (Unit)test your modules

➡ Test them with: puppet apply --noop

➡ More advanced testing: cucumber / cucumber-puppet (BDD)

35

woensdag 18 april 12

Page 67: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

http://docs.puppetlabs.com/references/stable/type.html

➡ Almost everything.

➡ standard 48 different resource types

➡ Ranging from “file” to “cron” to “ssh_key” to “user” to “selinux”.

➡ Can control your Cisco routers and windows machines too (sortakinda)

36

woensdag 18 april 12

Page 68: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

http://media.techtarget.com/digitalguide/images/Misc/puppetDashboard.gif

37

woensdag 18 april 12

Page 69: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

38

woensdag 18 april 12

Page 70: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

39

➡ Puppet went from v0.25 to v2.6.

➡ REST interface since 2.6. XMLRPC before that.

➡ One binary to rule them all (puppet).

➡ Puppet v2.7 switched from GPLv2 to apache2.0 license.

woensdag 18 april 12

Page 71: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

➡ --test does not mean dry-run!(--noop does).

➡ It’s not object oriented. (puppet class != php class)

➡ It’s a declarative language.

40

woensdag 18 april 12

Page 72: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

41

woensdag 18 april 12

Page 73: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

➡ Puppet agent “calls” the master every 30 minutes.

➡ But what about realtime command & control?

➡ “Puppet kick”... (meh)

➡ MCollective (Marionette Collective)

42

woensdag 18 april 12

Page 74: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

➡ Which systems running a database and have 16GB or less?

➡ Which systems are using <50% of available memory?

➡ Restart all apache services in timezone GMT+5.

43

woensdag 18 april 12

Page 75: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

ACTIVEMQClient

MCollectiveServer

NodeMiddlewareClient

MCollectiveServer

MCollectiveServer

‣ Middleware takes care of distribution,‣ queued, broadcast etc..

Collective

44

woensdag 18 april 12

Page 76: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

http://docs.puppetlabs.com/mcollective/reference/basic/subcollectives.html45

woensdag 18 april 12

Page 77: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

Filter out nodes based on facts

$ mc-facts operatingsystemReport for fact: operatingsystem

CentOS found 3 times Debian found 14 times Solaris found 4 times

$ mc-facts -W operatingsystem=Centos operatingsystemreleaseReport for fact: operatingsystemrelease

6.0 found 1 times 5.6 found 2 times

46

woensdag 18 april 12

Page 78: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

➡ Display all running processes

➡ Run or deploy software

➡ Restart services

➡ Start puppet agent

➡ Upgrade your systems

47

woensdag 18 april 12

Page 79: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

-ETOOMUCHINFO

Let’s recap

48

woensdag 18 april 12

Page 80: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

➡ Configuration management tool.

➡ Focusses on “what” instead of “how”.

➡ Scales from 1 to 100K+ systems.

➡ Uses descriptive manifests.

49

woensdag 18 april 12

Page 81: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

➡ Useful for sysadmins and developers.

➡ Keeps your infrastructure in sync.

➡ Keeps your infrastructure versioned.

➡ MCollective controls your hosts based on facts, not names.

50

woensdag 18 april 12

Page 82: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

There is no reason NOT to control your infrastructure.

Having only 3 servers is NOT a reason.

51

You will be able to join the rest of us in the pub early.

woensdag 18 april 12

Page 83: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

http://farm1.static.flickr.com/73/163450213_18478d3aa6_d.jpg 52

woensdag 18 april 12

Page 84: Puppet for Dummies - PROIDEA · Puppet for Dummies 4developers - 18 april 2012 ... What is puppet and why should I care? 3 ... windows machines too ...

Please rate my talk on joind.in: http://joind.in/6328

Thank you

53

Find me on twitter: @jaytaph

Find me for development and training: www.noxlogic.nl

Find me on email: [email protected]

Find me for blogs: www.adayinthelifeof.nl

woensdag 18 april 12