Slide 1

Slide 1 text

Setup the

Slide 2

Slide 2 text

managing an army of laptops ...with puppet

Slide 3

Slide 3 text

hi, my name is will farrington

Slide 4

Slide 4 text

but you might know me as @wfarr  

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

i work at a “little-known startup” called github

Slide 7

Slide 7 text

I work on System operations System operations internal apps the setup

Slide 8

Slide 8 text

why

Slide 9

Slide 9 text

once upon a time

Slide 10

Slide 10 text

there was a developer developer

Slide 11

Slide 11 text

there was a designer designer

Slide 12

Slide 12 text

oh man, this new macbook pro is sweet! let me run a bunch of stuff by hand so I can get some work done in about 6 to 8 hours, maybe. - some folks

Slide 13

Slide 13 text

once upon a time

Slide 14

Slide 14 text

there was a crazy person crazy person

Slide 15

Slide 15 text

oh man, this new macbook pro is sweet! let me run a bunch of stuff by hand so I can get some work done in about 6 to 8 hours, maybe. - a bunch of crazy folks

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

we made a huge mistake everybody

Slide 18

Slide 18 text

i thought we cared about stuff

Slide 19

Slide 19 text

testing

Slide 20

Slide 20 text

repeatability

Slide 21

Slide 21 text

Automation

Slide 22

Slide 22 text

they matter for our software

Slide 23

Slide 23 text

they matter for our servers

Slide 24

Slide 24 text

but not for our laptops

Slide 25

Slide 25 text

!!!

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

what

Slide 29

Slide 29 text

a living, breathing software project that tests and automates every little bit of your machine with love

Slide 30

Slide 30 text

@jbarnette

Slide 31

Slide 31 text

about 6000 about 3600 1415 38 lines of Ruby lines of Puppet commits contributors some numbers

Slide 32

Slide 32 text

chrome, colloquy, dropbox, elasticsearch, emacs, erlang, git, homebrew, hub, iterm2, java, macvim, memcache, mongodb, mysql, nginx, nodejs, nvm, 1passwd, personalization, postgresql, projects, python, qt, rbenv, rdio, redis, ruby, solr, sparrow, textmate, virtualbox, viscosity, wget, xcode, xquartz, zeromq, zsh, and more daily.

Slide 33

Slide 33 text

less than 6 months

Slide 34

Slide 34 text

in

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

hours of frustration getting github.com and other projects even working locally

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

reality

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

drink coffee for 20 minutes

Slide 42

Slide 42 text

Text

Slide 43

Slide 43 text

No content

Slide 44

Slide 44 text

The Command Line Interface

Slide 45

Slide 45 text

» gh-setup --projects * github

Slide 46

Slide 46 text

github » script/bootstrap github » script/server github » open github.dev # Ready to ship things!

Slide 47

Slide 47 text

» gh-setup octostatus # sets it all up. boom.

Slide 48

Slide 48 text

» gh-setup --stealth # development mode

Slide 49

Slide 49 text

No content

Slide 50

Slide 50 text

The Puppet DSL

Slide 51

Slide 51 text

is pretty easy

Slide 52

Slide 52 text

Resources

Slide 53

Slide 53 text

basically everything in puppet

Slide 54

Slide 54 text

package { ‘redis-server’: }

Slide 55

Slide 55 text

file { ‘/etc/motd’: content => ‘Hello, world!’ }

Slide 56

Slide 56 text

service { ‘riak’: ensure => running, subscribe => File[‘/etc/riak/vm.args’] } resource type

Slide 57

Slide 57 text

service { ‘riak’: ensure => running, subscribe => File[‘/etc/riak/vm.args’] } resource name

Slide 58

Slide 58 text

service { ‘riak’: ensure => running, subscribe => File[‘/etc/riak/vm.args’] } resource parameters

Slide 59

Slide 59 text

service { ‘riak’: ensure => running, subscribe => File[‘/etc/riak/vm.args’] } metaparameter

Slide 60

Slide 60 text

metaparameters are important

Slide 61

Slide 61 text

metaparameters are everywhere

Slide 62

Slide 62 text

before require subscribe notify this resource must run before this resource must run after this resource runs after and watches this resource runs before and tells

Slide 63

Slide 63 text

custom types

Slide 64

Slide 64 text

define git::config::local($key, $value) { $safekey = shellquote($key) $safevalue = shellquote($value) $command = "git config --local ${safekey} $ {safevalue}" exec { "${command} in ${name}": command => $command, cwd => $name, onlyif => 'test -d .git', unless => "git config --local ${safekey}", require => Package['git'] } }

Slide 65

Slide 65 text

git::config::local { ‘~/github/hubot’: key => ‘heroku.account’, value => ‘work’ }

Slide 66

Slide 66 text

Classes

Slide 67

Slide 67 text

class redis { package { ‘redis-server’: } service { ‘redis’: require => Package[‘redis-server’] } }

Slide 68

Slide 68 text

include/require

Slide 69

Slide 69 text

class myapp { require redis include amazingness::incarnate }

Slide 70

Slide 70 text

this matters a whole lot everybody

Slide 71

Slide 71 text

Puppet has its own dsl for reasons

Slide 72

Slide 72 text

puppet was designed for sysadmins

Slide 73

Slide 73 text

puppet was designed for sysadmins okay,

Slide 74

Slide 74 text

2. puppet has semantics about execution that would be confusing and unintuitive in ruby or python or most other languages a

Slide 75

Slide 75 text

puppet uses a DAG to apply resources

Slide 76

Slide 76 text

a DAG is a directed, acyclic graph

Slide 77

Slide 77 text

a DAG means relationships matter

Slide 78

Slide 78 text

code order does not imply execution order

Slide 79

Slide 79 text

No content

Slide 80

Slide 80 text

The Setup is a stdlib for puppet

Slide 81

Slide 81 text

 The Setup is a stdlib for puppet

Slide 82

Slide 82 text

class github::projects::octostatus { require redis ... }

Slide 83

Slide 83 text

class github::projects::octostatus { ... $dir = "${github::config::srcdir}/ octostatus" ... }

Slide 84

Slide 84 text

class github::projects::octostatus { ... git::repo { $dir: source => 'github/octostatus' } ... }

Slide 85

Slide 85 text

class github::projects::octostatus { ... ruby::local { $dir: version => '1.9.3-p194', require => Git::Repo[$dir] } }

Slide 86

Slide 86 text

No content

Slide 87

Slide 87 text

I like doing things my way

Slide 88

Slide 88 text

I like doing things my way

Slide 89

Slide 89 text

class github::people::hubot { include github::projects::all }

Slide 90

Slide 90 text

class github::people::keavy { require gitx require onepassword require sizeup require sparrow require textmate }

Slide 91

Slide 91 text

class github::people::yossef { package { 'Alfred': provider => 'appdmg', source => $alfred_dmg_url; } }

Slide 92

Slide 92 text

class github::people::yossef { setup::tarballed_app { 'Mailplane': source => $mailplane_url; } }

Slide 93

Slide 93 text

class github::people::wfarr { git::config::global { 'alias.st': value => 'status'; 'alias.ci': value => 'commit'; } }

Slide 94

Slide 94 text

class github::people::wfarr { file { '/Users/wfarr/.gitignore': ensure => present, content => '.DS_STORE' } }

Slide 95

Slide 95 text

class github::people::wfarr { package { 'emacs': } git::repo { '/Users/wfarr/.emacs.d': source => 'wfarr/.emacs.d', submodules => true } }

Slide 96

Slide 96 text

class github::people::wfarr { setup::osx_defaults { 'require password always': ensure => present, domain => 'com.apple.screensaver', key => 'askForPassword', value => 1, user => 'wfarr' } }

Slide 97

Slide 97 text

lessons

Slide 98

Slide 98 text

puppeteer supportocat

Slide 99

Slide 99 text

people will do crazy shit to it

Slide 100

Slide 100 text

if it breaks it is your job to fix it

Slide 101

Slide 101 text

if it breaks it is your job to fix it no matter what

Slide 102

Slide 102 text

developers and designers are really good at breaking things

Slide 103

Slide 103 text

people will not report “minor” problems

Slide 104

Slide 104 text

people will barely report “major” problems

Slide 105

Slide 105 text

No content

Slide 106

Slide 106 text

not having to report bugs makes people happy

Slide 107

Slide 107 text

getting regular bug reports makes us happy

Slide 108

Slide 108 text

users getting github notifications that the bug they hit and never even reported is already fixed

Slide 109

Slide 109 text

No content

Slide 110

Slide 110 text

reduce potential for bugs by vendoring

Slide 111

Slide 111 text

EVERYTHING

Slide 112

Slide 112 text

No content

Slide 113

Slide 113 text

No content

Slide 114

Slide 114 text

» du -sh /opt/github 3.8G /opt/github

Slide 115

Slide 115 text

there’s

Slide 116

Slide 116 text

No content

Slide 117

Slide 117 text

=(

Slide 118

Slide 118 text

» env | grep GH_ | wc -l 24

Slide 119

Slide 119 text

» env | grep \ GH_REDIS_PORT GH_REDIS_PORT=16379

Slide 120

Slide 120 text

» env | grep \ GH_MYSQL_PORT GH_MYSQL_PORT=13306

Slide 121

Slide 121 text

No content

Slide 122

Slide 122 text

people will never remember to update regularly

Slide 123

Slide 123 text

tell people when they should update

Slide 124

Slide 124 text

No content

Slide 125

Slide 125 text

sneak peek

Slide 126

Slide 126 text

=> Installing qt...

Slide 127

Slide 127 text

No content

Slide 128

Slide 128 text

No content

Slide 129

Slide 129 text

=> Fetching snapshot... => Installing qt...

Slide 130

Slide 130 text

=> Fetching snapshot... => Installing ruby-1.9.3...

Slide 131

Slide 131 text

=> Fetching snapshot... => Installing node-0.6.8...

Slide 132

Slide 132 text

we don't have the ability to mandate environments

Slide 133

Slide 133 text

we don't even want to mandate environments

Slide 134

Slide 134 text

we have to provide something dramatically better than just doing it yourself

Slide 135

Slide 135 text

prim donn

Slide 136

Slide 136 text

the setup is not a tool for it administrators

Slide 137

Slide 137 text

the setup is a tool for people who want to get stuff done, sanely

Slide 138

Slide 138 text

the setup has goals

Slide 139

Slide 139 text

user-extensible

Slide 140

Slide 140 text

framework

Slide 141

Slide 141 text

stable

Slide 142

Slide 142 text

easy to use

Slide 143

Slide 143 text

not a maintenance nightmare

Slide 144

Slide 144 text

zomg want

Slide 145

Slide 145 text

you don’t =(

Slide 146

Slide 146 text

... yet

Slide 147

Slide 147 text

we are working hard to open source it

Slide 148

Slide 148 text

Soon!

Slide 149

Slide 149 text

Setup the

Slide 150

Slide 150 text

questions

Slide 151

Slide 151 text

love ops? come work with us puppet, erlang, ruby, shell, c and all the graphs you can shake a stick at

Slide 152

Slide 152 text

No content

Slide 153

Slide 153 text

thanks