Boxen: How to Manage an Army of Laptops and Live to Talk About It

152
boxen

description

Will Farrington of Github talks about Boxen at Puppet Camp Atlanta, 2013. Original slides can be found: https://speakerdeck.com/wfarr/boxen-puppetcamp-atl Learn about upcoming Puppet Camps at http://puppetlabs.com/community/puppet-camp/

Transcript of Boxen: How to Manage an Army of Laptops and Live to Talk About It

Page 1: Boxen: How to Manage an Army of Laptops and Live to Talk About It

boxen

Page 2: Boxen: How to Manage an Army of Laptops and Live to Talk About It

wfarr

Page 3: Boxen: How to Manage an Army of Laptops and Live to Talk About It

ops

Page 4: Boxen: How to Manage an Army of Laptops and Live to Talk About It

friction

Page 5: Boxen: How to Manage an Army of Laptops and Live to Talk About It

what is boxen?

Page 6: Boxen: How to Manage an Army of Laptops and Live to Talk About It

STORY TIME

Page 7: Boxen: How to Manage an Army of Laptops and Live to Talk About It

@jbarnette + @wfarr

Page 8: Boxen: How to Manage an Army of Laptops and Live to Talk About It
Page 9: Boxen: How to Manage an Army of Laptops and Live to Talk About It
Page 10: Boxen: How to Manage an Army of Laptops and Live to Talk About It

developing software isharder than it used to be

Page 11: Boxen: How to Manage an Army of Laptops and Live to Talk About It

our toolchains have gottenmore robust

Page 12: Boxen: How to Manage an Army of Laptops and Live to Talk About It

our toolchains have gottenmore complicated

Page 13: Boxen: How to Manage an Army of Laptops and Live to Talk About It

want to work on $anything?

Page 14: Boxen: How to Manage an Army of Laptops and Live to Talk About It

better install a ruby version manager, like 8 versions of ruby, a handful of gems to try and make the behavior remotely sane, and

then pray it doesn't break

Page 15: Boxen: How to Manage an Army of Laptops and Live to Talk About It
Page 16: Boxen: How to Manage an Army of Laptops and Live to Talk About It

s/ruby/literally everything but bash/g

Page 17: Boxen: How to Manage an Army of Laptops and Live to Talk About It
Page 18: Boxen: How to Manage an Army of Laptops and Live to Talk About It

let's make it better

Page 19: Boxen: How to Manage an Army of Laptops and Live to Talk About It
Page 20: Boxen: How to Manage an Army of Laptops and Live to Talk About It
Page 21: Boxen: How to Manage an Army of Laptops and Live to Talk About It

THINGS BOXEN IS

Page 22: Boxen: How to Manage an Army of Laptops and Live to Talk About It

a framework

Page 23: Boxen: How to Manage an Army of Laptops and Live to Talk About It

stdlib

Page 24: Boxen: How to Manage an Army of Laptops and Live to Talk About It

wat

Page 25: Boxen: How to Manage an Army of Laptops and Live to Talk About It
Page 26: Boxen: How to Manage an Army of Laptops and Live to Talk About It
Page 27: Boxen: How to Manage an Army of Laptops and Live to Talk About It

THINGS BOXEN IS NOT

Page 28: Boxen: How to Manage an Army of Laptops and Live to Talk About It

nope

Page 29: Boxen: How to Manage an Army of Laptops and Live to Talk About It

nope

Page 30: Boxen: How to Manage an Army of Laptops and Live to Talk About It

newp

Page 31: Boxen: How to Manage an Army of Laptops and Live to Talk About It

sadly,no

Page 32: Boxen: How to Manage an Army of Laptops and Live to Talk About It

why should i use boxen?

Page 33: Boxen: How to Manage an Army of Laptops and Live to Talk About It

FRICTION SUCKS

Page 34: Boxen: How to Manage an Army of Laptops and Live to Talk About It

frictionis anything that

gets in the way of doing stuff

Page 35: Boxen: How to Manage an Army of Laptops and Live to Talk About It

frictionis the greatest source of

frustration in every organization

Page 36: Boxen: How to Manage an Army of Laptops and Live to Talk About It

configuring development environments is a week-long

marathon in friction

Page 37: Boxen: How to Manage an Army of Laptops and Live to Talk About It

"all right, new work laptop! i wonder where that blog post i used last time to set up ruby,

python, go, and git is. hopefully it still works and by the end of the

week i can start shipping."

Page 38: Boxen: How to Manage an Army of Laptops and Live to Talk About It

"all right, new work laptop! i wonder where that blog post i used last time to set up ruby,

python, go, and git is. hopefully it still works and by the end of the

week i can start shipping."lame

Page 39: Boxen: How to Manage an Army of Laptops and Live to Talk About It
Page 40: Boxen: How to Manage an Army of Laptops and Live to Talk About It
Page 41: Boxen: How to Manage an Army of Laptops and Live to Talk About It
Page 42: Boxen: How to Manage an Army of Laptops and Live to Talk About It
Page 43: Boxen: How to Manage an Army of Laptops and Live to Talk About It

getting any part of the stack running locally should never block

someone from shipping

Page 44: Boxen: How to Manage an Army of Laptops and Live to Talk About It

USS COOL STU

FF

Page 45: Boxen: How to Manage an Army of Laptops and Live to Talk About It
Page 46: Boxen: How to Manage an Army of Laptops and Live to Talk About It

INCONSISTENCY SUCKS

Page 47: Boxen: How to Manage an Army of Laptops and Live to Talk About It

when was the last time you knew every human was running the

same services in dev and prod?

Page 48: Boxen: How to Manage an Army of Laptops and Live to Talk About It
Page 49: Boxen: How to Manage an Army of Laptops and Live to Talk About It

"hey so my postgresql isn't working. is yours working? it is?

huh. i have no idea what's wrong."

Page 50: Boxen: How to Manage an Army of Laptops and Live to Talk About It

"hey so my postgresql isn't working. is yours working? it is?

huh. i have no idea what's wrong."lame

Page 51: Boxen: How to Manage an Army of Laptops and Live to Talk About It

manual audits aretedious

Page 52: Boxen: How to Manage an Army of Laptops and Live to Talk About It

manual audits areerror-prone

Page 53: Boxen: How to Manage an Army of Laptops and Live to Talk About It

ask software instead of humans

Page 54: Boxen: How to Manage an Army of Laptops and Live to Talk About It

lock every core component to the same version as in prod

Page 55: Boxen: How to Manage an Army of Laptops and Live to Talk About It

UPDATING SUCKS

Page 56: Boxen: How to Manage an Army of Laptops and Live to Talk About It

"jeeeeeez the mac app store has been bugging me for like forever! i

have a billion updates... meh"

Page 57: Boxen: How to Manage an Army of Laptops and Live to Talk About It

"jeeeeeez the mac app store has been bugging me for like forever! i

have a billion updates... meh"lame

Page 58: Boxen: How to Manage an Army of Laptops and Live to Talk About It

maybe you use CM in dev already,but when was the last time

you updated and ran it?

Page 59: Boxen: How to Manage an Army of Laptops and Live to Talk About It

SECURITY SUCKS

Page 60: Boxen: How to Manage an Army of Laptops and Live to Talk About It

security is a war of attrition

Page 61: Boxen: How to Manage an Army of Laptops and Live to Talk About It

bug people enough about security and they stop caring about it

Page 62: Boxen: How to Manage an Army of Laptops and Live to Talk About It

"ugh, another security thing? whatever, i have way more

important things to do"

Page 63: Boxen: How to Manage an Army of Laptops and Live to Talk About It

"ugh, another security thing? whatever, i have way more

important things to do"lame

Page 64: Boxen: How to Manage an Army of Laptops and Live to Talk About It

let code handle security,then inform people so they know why the code's making changes

Page 65: Boxen: How to Manage an Army of Laptops and Live to Talk About It

no surprises

Page 66: Boxen: How to Manage an Army of Laptops and Live to Talk About It

BOXEN ENABLES YOU TO MAKE THESE THINGS

BETTER FOR YOUR ORG

Page 67: Boxen: How to Manage an Army of Laptops and Live to Talk About It
Page 68: Boxen: How to Manage an Army of Laptops and Live to Talk About It

what do i get?

Page 69: Boxen: How to Manage an Army of Laptops and Live to Talk About It

RUNNER

Page 70: Boxen: How to Manage an Army of Laptops and Live to Talk About It

boxen is run via some ruby

Page 71: Boxen: How to Manage an Army of Laptops and Live to Talk About It

it collects info for facter

Page 72: Boxen: How to Manage an Army of Laptops and Live to Talk About It

it checks for prerequisites and conflicts before each run

Page 73: Boxen: How to Manage an Army of Laptops and Live to Talk About It

it detects certain changes post-run

Page 74: Boxen: How to Manage an Army of Laptops and Live to Talk About It

it has hooks too

Page 75: Boxen: How to Manage an Army of Laptops and Live to Talk About It

PUPPET

Page 76: Boxen: How to Manage an Army of Laptops and Live to Talk About It

"the core"

Page 77: Boxen: How to Manage an Army of Laptops and Live to Talk About It

homebrew, git, hub, gcc, rbenv, ruby 1.8.7, ruby 1.9.3, ruby 2.0.0, nvm, nodejs 0.4.x, nodejs 0.6.x,

nodejs 0.8.x, nginx, .dev dns, FDE, and puppetlabs-stdlib

Page 78: Boxen: How to Manage an Army of Laptops and Live to Talk About It

rbenv_gem, repository, osx_chsh, osx_login_item, boxen::project,

ruby::local, mysql::database, etc.

Page 79: Boxen: How to Manage an Army of Laptops and Live to Talk About It

package: homebrew, compressed_app

Page 80: Boxen: How to Manage an Army of Laptops and Live to Talk About It

repository: git

Page 81: Boxen: How to Manage an Army of Laptops and Live to Talk About It

service: ghlaunchd

Page 82: Boxen: How to Manage an Army of Laptops and Live to Talk About It

"the library"

Page 83: Boxen: How to Manage an Army of Laptops and Live to Talk About It

130+ modules on GitHub

Page 84: Boxen: How to Manage an Army of Laptops and Live to Talk About It

GitHub uses ~81 of those

Page 85: Boxen: How to Manage an Army of Laptops and Live to Talk About It

travis-ci

Page 86: Boxen: How to Manage an Army of Laptops and Live to Talk About It

CARDBOARD

Page 87: Boxen: How to Manage an Army of Laptops and Live to Talk About It

gem that simplifies creating new puppet modules, optimized for the

boxen-recommended stack

Page 88: Boxen: How to Manage an Army of Laptops and Live to Talk About It

librarian-puppet, rspec-puppet, puppet-lint, etc.

Page 89: Boxen: How to Manage an Army of Laptops and Live to Talk About It

PUPPET-TEMPLATE

Page 90: Boxen: How to Manage an Army of Laptops and Live to Talk About It

example module using cardboard

Page 91: Boxen: How to Manage an Army of Laptops and Live to Talk About It

OUR-BOXEN

Page 92: Boxen: How to Manage an Army of Laptops and Live to Talk About It

template boxen project

Page 93: Boxen: How to Manage an Army of Laptops and Live to Talk About It

BOXEN-WEB

Page 94: Boxen: How to Manage an Army of Laptops and Live to Talk About It

small rails app to allow distributing your boxen easily, with auth

Page 95: Boxen: How to Manage an Army of Laptops and Live to Talk About It

how do i get it?

Page 96: Boxen: How to Manage an Army of Laptops and Live to Talk About It

Automate Everything

Page 97: Boxen: How to Manage an Army of Laptops and Live to Talk About It

boxen/boxen-web

Page 98: Boxen: How to Manage an Army of Laptops and Live to Talk About It
Page 99: Boxen: How to Manage an Army of Laptops and Live to Talk About It

how do i use it?

Page 100: Boxen: How to Manage an Army of Laptops and Live to Talk About It

CLI

Page 101: Boxen: How to Manage an Army of Laptops and Live to Talk About It

$ boxen

# run it

Page 102: Boxen: How to Manage an Army of Laptops and Live to Talk About It

$ boxen --projects

# list projects Boxen knows about

Page 103: Boxen: How to Manage an Army of Laptops and Live to Talk About It

$ boxen <project>

# run it but include <project> in the catalog automatically

Page 104: Boxen: How to Manage an Army of Laptops and Live to Talk About It

PROJECT MANIFESTS

Page 105: Boxen: How to Manage an Army of Laptops and Live to Talk About It

i want to hack on my project

Page 106: Boxen: How to Manage an Army of Laptops and Live to Talk About It

# modules/projects/manifests/team.pp

class projects::team { boxen::project { 'team': dotenv => true, mysql => true, nginx => true, ruby => '1.9.3', source => 'github/team', }}

Page 107: Boxen: How to Manage an Army of Laptops and Live to Talk About It

$ boxen team

warning: Setting up 'team'. This can be made permanent by having 'include projects::team' in your personal manifest.

Page 108: Boxen: How to Manage an Army of Laptops and Live to Talk About It

cloned repo

nginx vhost

ruby version

mysql databases

.env file

Page 109: Boxen: How to Manage an Army of Laptops and Live to Talk About It

$ cd ~/src/team$ script/server$ open http://team.dev/

Page 110: Boxen: How to Manage an Army of Laptops and Live to Talk About It

PERSONAL MANIFESTS

Page 111: Boxen: How to Manage an Army of Laptops and Live to Talk About It

i want to install $x but only for me

Page 112: Boxen: How to Manage an Army of Laptops and Live to Talk About It

# modules/people/manifests/wfarr.pp

class people::wfarr { include minecraft}

Page 113: Boxen: How to Manage an Army of Laptops and Live to Talk About It

# modules/people/manifests/wfarr.pp

class people::wfarr { include zsh}

Page 114: Boxen: How to Manage an Army of Laptops and Live to Talk About It

# modules/people/manifests/wfarr.pp

class people::wfarr { case $::hostname { 'bender': { include projects::all }

'scruffy': { include projects::team }

default: {} }}

Page 115: Boxen: How to Manage an Army of Laptops and Live to Talk About It

# modules/people/manifests/wfarr.pp

class people::wfarr {  git::config::global {    'alias.st': value => 'status';    'alias.ci': value => 'commit';    'alias.di': value => 'diff';    'alias.lp': value => 'log -p';    'color.ui': value => 'true';    'user.name': value => 'Will Farrington';    'user.email': value => '[email protected]';  }}

Page 116: Boxen: How to Manage an Army of Laptops and Live to Talk About It

# modules/people/manifests/wfarr.pp

class people::wfarr { include osx::example_things}

Page 117: Boxen: How to Manage an Army of Laptops and Live to Talk About It

ISSUES

Page 118: Boxen: How to Manage an Army of Laptops and Live to Talk About It

$ boxenError: ZOMG at /opt/boxen/repo/modules/people/manifests/wfarr.pp:8 on node scruffy.gateway.github.lan

Sorry! Creating an issue on github/totally-a-madeup-repo-name.

Page 119: Boxen: How to Manage an Army of Laptops and Live to Talk About It

CODEZ

Page 120: Boxen: How to Manage an Army of Laptops and Live to Talk About It

CODEZ

who failed

Page 121: Boxen: How to Manage an Army of Laptops and Live to Talk About It

CODEZ

how long ago

Page 122: Boxen: How to Manage an Army of Laptops and Live to Talk About It

CODEZ machine

Page 123: Boxen: How to Manage an Army of Laptops and Live to Talk About It

CODEZ

os version

Page 124: Boxen: How to Manage an Army of Laptops and Live to Talk About It

CODEZ shell

Page 125: Boxen: How to Manage an Army of Laptops and Live to Talk About It

CODEZref

Page 126: Boxen: How to Manage an Army of Laptops and Live to Talk About It

CODEZcompare view

Page 127: Boxen: How to Manage an Army of Laptops and Live to Talk About It

CODEZgit status

Page 128: Boxen: How to Manage an Army of Laptops and Live to Talk About It

CODEZ

full command

Page 129: Boxen: How to Manage an Army of Laptops and Live to Talk About It

CODEZ

full log

Page 130: Boxen: How to Manage an Army of Laptops and Live to Talk About It

i fix the error and run `boxen`

Page 131: Boxen: How to Manage an Army of Laptops and Live to Talk About It

CODEZ

Page 132: Boxen: How to Manage an Army of Laptops and Live to Talk About It

via issues api

Page 133: Boxen: How to Manage an Army of Laptops and Live to Talk About It

# config/boxen.rb

ENV['BOXEN_REPO_NAME'] = \ 'github/boxen'

ENV['BOXEN_ISSUES_ENABLED'] = 'yes'

Page 134: Boxen: How to Manage an Army of Laptops and Live to Talk About It

UPDATES

Page 135: Boxen: How to Manage an Army of Laptops and Live to Talk About It

$ boxen

Boxen is up-to-date.

Page 136: Boxen: How to Manage an Army of Laptops and Live to Talk About It

$ boxen

Boxen has a dirty tree, won't auto-update!

Page 137: Boxen: How to Manage an Army of Laptops and Live to Talk About It

$ boxen

Boxen has unpushed commits on master, won't auto-update!

Page 138: Boxen: How to Manage an Army of Laptops and Live to Talk About It

$ boxen

Boxen on a non-master branch 'new-project', won't auto-update!

Page 139: Boxen: How to Manage an Army of Laptops and Live to Talk About It

i'm sold.

Page 140: Boxen: How to Manage an Army of Laptops and Live to Talk About It
Page 141: Boxen: How to Manage an Army of Laptops and Live to Talk About It

what if i have problems?

Page 142: Boxen: How to Manage an Army of Laptops and Live to Talk About It

file issues

Page 143: Boxen: How to Manage an Army of Laptops and Live to Talk About It

irc.freenode.net

Page 144: Boxen: How to Manage an Army of Laptops and Live to Talk About It

be chuck yeager

Page 145: Boxen: How to Manage an Army of Laptops and Live to Talk About It
Page 146: Boxen: How to Manage an Army of Laptops and Live to Talk About It

"So, we're uh in the air. We made it. That's uh good news,

obviously."

Page 147: Boxen: How to Manage an Army of Laptops and Live to Talk About It

"Flight attendants, if you could just hang on to uh... whatever..."

Page 148: Boxen: How to Manage an Army of Laptops and Live to Talk About It

detail text

Page 149: Boxen: How to Manage an Army of Laptops and Live to Talk About It

wfarr

come work with me on things like boxen

Page 150: Boxen: How to Manage an Army of Laptops and Live to Talk About It

CODEZ

Page 151: Boxen: How to Manage an Army of Laptops and Live to Talk About It

thanks

Page 152: Boxen: How to Manage an Army of Laptops and Live to Talk About It

speakerdeck.com/wfarr/boxen-puppetcamp-atl