Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ......

81
Luke Kanies [email protected] Founder, Reductive Labs Nashville, Tennessee USA Using Puppet Why it exists, how it works, and why it works this way

Transcript of Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ......

Page 1: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Luke [email protected], Reductive Labs

Nashville, TennesseeUSA

Using Puppet

Why it exists, how it works, and why it works this way

Page 2: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Introductions

Image from http://www.flickr.com/photos/tafa/27605946/sizes/o/

* How many of you would consider yourselves sysadmins?* How many of you manage sysadmins?* Frightening: How many of you are managed by sysadmins?* How many of you have heard of Puppet?* How many of you use Puppet?

Page 3: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Puppet is a system for centrally specifying and

managing your infrastructure

Page 4: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Written in Ruby

Page 5: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Three major pieces

Page 6: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

• A declarative, resource-oriented language

Three major pieces

Page 7: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

• A declarative, resource-oriented language

• An execution engine

Three major pieces

Page 8: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

• A declarative, resource-oriented language

• An execution engine

• A bunch of daemons and tools

Three major pieces

Page 9: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

1) A resource-oriented language

Image from http://www.flickr.com/photos/heather/147388906/sizes/l/

Page 10: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Your infrastructure is code

Image from http://www.flickr.com/photos/echo_29/25829591/sizes/o/

And code is great because we have tooling like version control, and decades of experience with it

Page 11: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Resource Abstraction Layer (RAL)

Page 12: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Do you really care how rpm works?

rpm/apt/etc becomes packages/etc/hosts becomes hostsuseradd/netinfo, etc. becomes users/etc/init.d/smf/launchd/daemontools becomes services

Page 13: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Resource Providers

23 package types

Users in NetInfo, useradd, pw

Support for Debian, Ubuntu, Red Hat, Solaris, OS X, Gentoo, SuSE, FreeBSD, and more

Windows is being actively worked on

Page 14: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

2) An engine for applying

that specification repeatably

Image from http://www.flickr.com/photos/jurvetson/480227362/sizes/l/

Page 15: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

2) An engine for applying

that specification repeatably

Image from http://www.flickr.com/photos/jurvetson/480227362/sizes/l/

Page 16: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Specifications are idempotent

Idempotency is what allows us to manage a machine through its whole lifecycle

Page 17: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Specifications are idempotent

Idempotency is what allows us to manage a machine through its whole lifecycle

Page 18: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

3) Daemons and executables that

determine Puppet’s architecture

client/server, cert mgmt, etc.

Page 19: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Centralized Management

puppetd in the cloud

Puppetmasterd

puppetdOS X puppetd

Linux

Code

Page 20: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Uses SSL, and provides a Certificate Authority

Image from http://www.flickr.com/photos/piet_musterd/2307596484/sizes/l/

* Every connection is encrypted, and the only connection that isn’t authenticated is the one that asks for a signed cert* Client certs* Autosign, manual sign, manual certificate generation* You don’t even have to use it

Page 21: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

ralsh - a thin API wrapper

This uses the same model as the rest of puppet -- it chooses the appropriate provider for the local system. You can edit resources, and it even works over the network.

Page 22: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Who’s using Puppet?

“...at Google we're currently using Puppet to

manage close to 6,000 Macs, and it's likely our deployment will expand

dramatically beyond that....”

Testimonials

. . .at Google we're currently using it to manage close to 6,000 Macs, and it's likely our deployment will expand dramatically beyond that. . . Nigel KerstenMacOps

Thank You Puppet!! . . .We had a guy on staff who was doing only these things almost full time, so puppet's allowed him to do bigger and better things (like take Christmas break off :) Eugene Ventimiglia Director of Systems GridApp Systemsd

User Community Who Volunteer Info(http://reductivelabs.com/trac/puppet/wiki/WhosUsingPuppet)

The Ohio State University Department of Mathematics- Primarily used for: Mac OS X workstation and GNU/Linux server management.

Wordtracker- We introduced Puppet gradually by managing a handful of office workstations, and are now developing recipes for building servers with it

Imperial College London HEP group- We use puppet to manage our HPC clusters, our desktops and some of our servers

Bashton Ltd- Country: UK- We use Puppet to manage our own cluster of servers, as well as creating and supporting configurations for our customers

Fab:IT ApS- We use puppet to administrate our own servers placed in the local datacenter, and our customers placed both in the same datacenter, and scattered around the country. Puppet is ideal

because of it's ease of use, and especially because the puppet server compiles the configuration specifically for the individual host, so that no irrelevant information goes to the wrong nodes. Thanks, Luke, for a great tool!

- Country: Denmark

Geni Inc. (www.geni.com)- We use puppet to manage the configurations of all our Linux servers. With puppet my server build time is roughly 12-15 minutes to get a server ready for production.

Institute of Cognitive Science at the University of Osnabrueck, Germany- After having some headaches with cfengine, we started managing our linux workstations with puppet.- Shortly after Linux, we also started managing our Mac OS X workstations.

Page 23: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Why does Puppet exist?

Page 24: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Somebody has to do something, and it's just incredibly pathetic that it has to be us.

-- Jerry Garcia

Page 25: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Community

• 1000+ people on the mailing lists

• 200+ people in IRC all day

• More than 50 contributors

Page 26: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification
Page 27: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification
Page 28: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Programming SysAdmin

Low-level, non-portable

Assembly commands and files

Abstract, portable C* Resources

An Analogy

* For small values of abstract

* The assembly programmers fought the adoption of C* Fear for your career if you’re a bit too fond of assembly* It’s not about fewer people, it’s about higher quality and productivity* Are there more or fewer programmers today than in the days of assembly?

Page 29: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Image from http://flickr.com/photos/kenskritters/2128853769/

Speciation

These are house finches, reminding one of the finches Darwin observed in the Galapagos. I want to cause sysadmin speciation.

Page 30: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Sysadmins do too much

Image from http://flickr.com/photos/shirleytwofeathers/2068713495/

Firefighter? Architect? Developer? Tape-changer? All of the above?

Page 31: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Let’s talk about you

Do you have any computers?

Page 32: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Some questions

Page 33: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Some questions

• How many of you have written software to manage computers?

Page 34: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Some questions

• How many of you have written software to manage computers?

• How many have published this software?

Page 35: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Developer Sysadmin

Page 36: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Developer Sysadmin

Three people

Page 37: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Puppet allows you to bridge that gap

Image from http://www.flickr.com/photos/patrick-smith-photography/2969769911/sizes/o/

Page 38: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Either you can manage many machines with little effort

Page 39: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Either you can manage many machines with little effort

Or you can’t

Page 40: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

How to use Puppet

The strategical version

Page 41: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Seek the pain

Image from http://www.flickr.com/photos/pagedooley/2147718252/sizes/l/

Page 42: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Solve the simple problems

Page 43: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Add the infrastructure features you always

wanted

Page 44: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

How to use Puppet

The tactical version

Page 45: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Think like Puppet thinks

Page 46: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Think like Puppet thinks

• Resources, not text snippets or lines added to files

Page 47: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Think like Puppet thinks

• Resources, not text snippets or lines added to files

• What resources are you managing?

Page 48: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Think like Puppet thinks

• Resources, not text snippets or lines added to files

• What resources are you managing?

• How are they related to each other?

Page 49: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Replace Shell Scripts with ResourcesThis:

Page 50: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Replace Shell Scripts with Resources

Becomes:

This:

Page 51: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Replace Shell Scripts with Resources

Becomes:

This:

Page 52: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Replace Shell Scripts with Resources

Becomes:

This:

Page 53: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Replace Shell Scripts with Resources

Becomes:

This:

Page 54: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Relationships matter but are often implicit

Page 55: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Relationships matter but are often implicit

Package

Page 56: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Relationships matter but are often implicit

Package

Configuration

Configuration should get modifed after package

installation

Page 57: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Relationships matter but are often implicit

Package

Service

Service should restart whenconfiguration changesConfiguration

Configuration should get modifed after package

installation

Page 58: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Explicit Relationships

We’ll come back to abstraction

Page 59: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Relationships provide ordering and notification

"Exec[createrepo-PM-RHEL5-noarch]"

"Yumrepo[PM-RHEL5-x86_64]"

"Yumrepo[PM-RHEL5-noarch]"

"Package[postgresql-server]"

"Package[thttpd]"

"File[/var/www/thttpd/html/yum-PM-RHEL5-noarch]""File[/var/www/thttpd/html/yum-PM-RHEL5-x86_64]"

"Exec[rsync-rpmdir-PM-RHEL5-x86_64]"

"Exec[createrepo-PM-RHEL5-x86_64]"

"Postgres::Role[puppet]"

"Exec[rsync-rpmdir-PM-RHEL5-noarch]"

Page 60: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Classes document Intent

This is shareable, releasable code.Classes are analogous with tags

Page 61: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Organize files into modules

Page 62: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Provide platform abstraction

Debian

We’re doing the same thing with different commands on different platforms

Page 63: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Provide platform abstraction

Debian

Red Hat

We’re doing the same thing with different commands on different platforms

Page 64: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Provide platform abstraction

Debian

Red Hat

We’re doing the same thing with different commands on different platforms

Page 65: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Portability and Naming

Page 66: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Class Membership

Page 67: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Class Membership

Page 68: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Puppet in the cloud

Page 69: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Heavily used in EC2, VMWare, Xen, etc

Page 70: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Puppet allows you to avoid the foil ball

Image from http://www.flickr.com/photos/fungep/2516767121/sizes/l_

Page 71: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

The Gory Details

Page 72: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Status and Roadmap

• In production usage for years

• About to release a new version with significant internal refactoring

• Adding simple graphical tools this year

Page 73: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Puppet and Capistrano

or ControlTier

Page 74: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Puppet vs. Cfengine

Page 75: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

It scales like HTTPS

because it is https

And you don’t even need to centralize it.

Page 76: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Logs go to syslog (by default)

Page 77: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

The people behind Puppet

This is all I do

Page 78: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Bad product,hungry Luke

Page 79: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Employs three people and still growing

Page 80: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Support, Paid features, Consulting, Training

Page 81: Using Puppet - NETWAYS · Using Puppet Why it exists, how it works, and why it works this way. ... Windows is being actively worked on. 2) An engine for applying that specification

Questions?