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 but @wfarr is way shorter

Slide 4

Slide 4 text

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

Slide 5

Slide 5 text

I work on System operations System operations internal apps the setup

Slide 6

Slide 6 text

why

Slide 7

Slide 7 text

once upon a time

Slide 8

Slide 8 text

there was a developer

Slide 9

Slide 9 text

there was a designer

Slide 10

Slide 10 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 perfectly normal people

Slide 11

Slide 11 text

once upon a time

Slide 12

Slide 12 text

there was a crazy person

Slide 13

Slide 13 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. ~ crazy people

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

we made a HUGE mistake

Slide 16

Slide 16 text

yep, it’s pretty bad

Slide 17

Slide 17 text

i thought we cared about testing

Slide 18

Slide 18 text

i thought we cared about repeatability

Slide 19

Slide 19 text

i thought we cared about automation

Slide 20

Slide 20 text

we say those things matter for software and they totally do

Slide 21

Slide 21 text

we do not treat our laptops like they matter

Slide 22

Slide 22 text

wtf is wrong with us

Slide 23

Slide 23 text

wtf is wrong with us i mean srsly guise

Slide 24

Slide 24 text

spock approves this message

Slide 25

Slide 25 text

what

Slide 26

Slide 26 text

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

Slide 27

Slide 27 text

@jbarnette

Slide 28

Slide 28 text

about 6000 about 3600 1186 26 lines of Ruby (not incl. tests) lines of Puppet (not incl. tests) commits contributors some numbers

Slide 29

Slide 29 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 30

Slide 30 text

less than 6 months

Slide 31

Slide 31 text

a githubber’s first day in

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

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

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

a githubber’s first day now

Slide 36

Slide 36 text

No content

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

drink coffee for 20 minutes

Slide 39

Slide 39 text

Text

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

The Command Line Interface

Slide 42

Slide 42 text

» gh-setup --projects * github

Slide 43

Slide 43 text

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

Slide 44

Slide 44 text

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

Slide 45

Slide 45 text

» gh-setup --stealth # development mode

Slide 46

Slide 46 text

No content

Slide 47

Slide 47 text

The Puppet DSL

Slide 48

Slide 48 text

The Puppet DSL is pretty easy actually

Slide 49

Slide 49 text

Resources

Slide 50

Slide 50 text

Resources are the basic unit of puppet

Slide 51

Slide 51 text

package { ‘redis-server’: }

Slide 52

Slide 52 text

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

Slide 53

Slide 53 text

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

Slide 54

Slide 54 text

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

Slide 55

Slide 55 text

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

Slide 56

Slide 56 text

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

Slide 57

Slide 57 text

metaparameters work on every resource

Slide 58

Slide 58 text

metaparameters describe relationships

Slide 59

Slide 59 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 60

Slide 60 text

resources can have custom types

Slide 61

Slide 61 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 62

Slide 62 text

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

Slide 63

Slide 63 text

Resources can be grouped with classes

Slide 64

Slide 64 text

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

Slide 65

Slide 65 text

classes can mixin other classes

Slide 66

Slide 66 text

classes can require other classes

Slide 67

Slide 67 text

this matters a whole lot everybody

Slide 68

Slide 68 text

Puppet has its own dsl for a couple reasons

Slide 69

Slide 69 text

1. puppet was designed for sysadmin-types

Slide 70

Slide 70 text

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

Slide 71

Slide 71 text

puppet uses a DAG to apply resources

Slide 72

Slide 72 text

a DAG is a directed, acyclic graph

Slide 73

Slide 73 text

a DAG means relationships matter

Slide 74

Slide 74 text

a DAG also means order of execution does not matter

Slide 75

Slide 75 text

No content

Slide 76

Slide 76 text

The Setup as a standard library for puppet but designed for personal laptops

Slide 77

Slide 77 text

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

Slide 78

Slide 78 text

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

Slide 79

Slide 79 text

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

Slide 80

Slide 80 text

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

Slide 81

Slide 81 text

I like doing things my way

Slide 82

Slide 82 text

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

Slide 83

Slide 83 text

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

Slide 84

Slide 84 text

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

Slide 85

Slide 85 text

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

Slide 86

Slide 86 text

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

Slide 87

Slide 87 text

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

Slide 88

Slide 88 text

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

Slide 89

Slide 89 text

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

Slide 90

Slide 90 text

lessons

Slide 91

Slide 91 text

puppeteer supportocat

Slide 92

Slide 92 text

people will do crazy shit to it

Slide 93

Slide 93 text

if it breaks it is your job to fix it

Slide 94

Slide 94 text

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

Slide 95

Slide 95 text

devs are really good at breaking things

Slide 96

Slide 96 text

people report about 1% of issues they have

Slide 97

Slide 97 text

people report about 1% of issues they have on a really good day

Slide 98

Slide 98 text

No content

Slide 99

Slide 99 text

rapid iteration on bugs makes people happy

Slide 100

Slide 100 text

avoiding more bugs makes us happy

Slide 101

Slide 101 text

reduce potential for bugs by vendoring

Slide 102

Slide 102 text

EVERYTHING

Slide 103

Slide 103 text

No content

Slide 104

Slide 104 text

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

Slide 105

Slide 105 text

there’s

Slide 106

Slide 106 text

No content

Slide 107

Slide 107 text

=(

Slide 108

Slide 108 text

» env | grep GH_ | wc -l 24

Slide 109

Slide 109 text

» env | grep GH_REDIS_PORT GH_REDIS_PORT=16379

Slide 110

Slide 110 text

» env | grep GH_MYSQL_PORT GH_MYSQL_PORT=13306

Slide 111

Slide 111 text

No content

Slide 112

Slide 112 text

people just will never remember to update

Slide 113

Slide 113 text

tell people when they should update

Slide 114

Slide 114 text

No content

Slide 115

Slide 115 text

omg sneak peek time

Slide 116

Slide 116 text

=> Installing qt...

Slide 117

Slide 117 text

No content

Slide 118

Slide 118 text

No content

Slide 119

Slide 119 text

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

Slide 120

Slide 120 text

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

Slide 121

Slide 121 text

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

Slide 122

Slide 122 text

we don't have the ability to mandate environments

Slide 123

Slide 123 text

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

Slide 124

Slide 124 text

prim donn

Slide 125

Slide 125 text

the setup is not a tool for it administrators

Slide 126

Slide 126 text

the setup is a tool for people to get stuff done

Slide 127

Slide 127 text

the setup is extensible by users

Slide 128

Slide 128 text

the setup is a stable framework for config

Slide 129

Slide 129 text

the setup is about enabling good patterns

Slide 130

Slide 130 text

the setup is not about dictating machine policy

Slide 131

Slide 131 text

how do i get it

Slide 132

Slide 132 text

you don’t =(

Slide 133

Slide 133 text

... yet

Slide 134

Slide 134 text

we are working hard to open source it

Slide 135

Slide 135 text

Soon!

Slide 136

Slide 136 text

Setup the

Slide 137

Slide 137 text

questions

Slide 138

Slide 138 text

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

Slide 139

Slide 139 text

No content

Slide 140

Slide 140 text

thanks