Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Boxen: PuppetCamp ATL

Boxen: PuppetCamp ATL

A Boxen talk focused at folks who might attend a PuppetCamp.

Will Farrington

March 19, 2013
Tweet

More Decks by Will Farrington

Other Decks in Technology

Transcript

  1. boxen

    View Slide


  2. wfarr

    View Slide


  3. ops

    View Slide


  4. friction

    View Slide

  5. what is boxen?

    View Slide

  6. STORY TIME

    View Slide

  7. @jbarnette + @wfarr

    View Slide

  8. View Slide

  9. View Slide

  10. developing software is
    harder than it used to be

    View Slide

  11. our toolchains have gotten
    more robust

    View Slide

  12. our toolchains have gotten
    more complicated

    View Slide

  13. want to work on $anything?

    View Slide

  14. 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

    View Slide

  15. View Slide

  16. s/ruby/literally everything but
    bash/g

    View Slide

  17. View Slide

  18. let's make it better

    View Slide

  19. View Slide

  20. View Slide

  21. THINGS BOXEN IS

    View Slide


  22. a framework

    View Slide


  23. stdlib

    View Slide

  24. wat

    View Slide

  25. View Slide

  26. View Slide

  27. THINGS BOXEN IS NOT

    View Slide

  28. nope

    View Slide

  29. nope

    View Slide

  30. newp

    View Slide

  31. sadly,
    no

    View Slide

  32. why should i use
    boxen?

    View Slide

  33. FRICTION SUCKS

    View Slide

  34. friction
    is anything that
    gets in the way of doing stuff

    View Slide

  35. friction
    is the greatest source of
    frustration in every organization

    View Slide

  36. configuring development
    environments is a week-long
    marathon in friction

    View Slide

  37. "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."

    View Slide

  38. "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

    View Slide

  39. View Slide

  40. View Slide

  41. View Slide

  42. View Slide

  43. getting any part of the stack
    running locally should never block
    someone from shipping

    View Slide

  44. USS COOL STUFF

    View Slide

  45. View Slide

  46. INCONSISTENCY SUCKS

    View Slide

  47. when was the last time you knew
    every human was running the
    same services in dev and prod?

    View Slide

  48. View Slide

  49. "hey so my postgresql isn't
    working. is yours working? it is?
    huh. i have no idea what's wrong."

    View Slide

  50. "hey so my postgresql isn't
    working. is yours working? it is?
    huh. i have no idea what's wrong."
    lame

    View Slide

  51. manual audits are
    tedious

    View Slide

  52. manual audits are
    error-prone

    View Slide

  53. ask software instead of humans

    View Slide

  54. lock every core component to the
    same version as in prod

    View Slide

  55. UPDATING SUCKS

    View Slide

  56. "jeeeeeez the mac app store has
    been bugging me for like forever! i
    have a billion updates... meh"

    View Slide

  57. "jeeeeeez the mac app store has
    been bugging me for like forever! i
    have a billion updates... meh"
    lame

    View Slide

  58. maybe you use CM in dev already,
    but when was the last time
    you updated and ran it?

    View Slide

  59. SECURITY SUCKS

    View Slide

  60. security is a war of attrition

    View Slide

  61. bug people enough about security
    and they stop caring about it

    View Slide

  62. "ugh, another security thing?
    whatever, i have way more
    important things to do"

    View Slide

  63. "ugh, another security thing?
    whatever, i have way more
    important things to do"
    lame

    View Slide

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

    View Slide

  65. no surprises

    View Slide

  66. BOXEN ENABLES YOU TO
    MAKE THESE THINGS
    BETTER FOR YOUR ORG

    View Slide

  67. View Slide

  68. what do i get?

    View Slide

  69. RUNNER

    View Slide

  70. boxen is run via some ruby

    View Slide

  71. it collects info for facter

    View Slide

  72. it checks for prerequisites and
    conflicts before each run

    View Slide

  73. it detects certain changes post-run

    View Slide

  74. it has hooks too

    View Slide

  75. PUPPET

    View Slide

  76. "the core"

    View Slide

  77. 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

    View Slide

  78. rbenv_gem, repository, osx_chsh,
    osx_login_item, boxen::project,
    ruby::local, mysql::database, etc.

    View Slide

  79. package: homebrew,
    compressed_app

    View Slide

  80. repository: git

    View Slide

  81. service: ghlaunchd

    View Slide

  82. "the library"

    View Slide

  83. 130+ modules on GitHub

    View Slide

  84. GitHub uses ~81 of those

    View Slide

  85. travis-ci

    View Slide

  86. CARDBOARD

    View Slide

  87. gem that simplifies creating new
    puppet modules, optimized for the
    boxen-recommended stack

    View Slide

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

    View Slide

  89. PUPPET-TEMPLATE

    View Slide

  90. example module using cardboard

    View Slide

  91. OUR-BOXEN

    View Slide

  92. template boxen project

    View Slide

  93. BOXEN-WEB

    View Slide

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

    View Slide

  95. how do i get it?

    View Slide

  96. Automate Everything

    View Slide

  97. boxen/boxen-web

    View Slide

  98. View Slide

  99. how do i use it?

    View Slide

  100. CLI

    View Slide

  101. $ boxen
    # run it

    View Slide

  102. $ boxen --projects
    # list projects Boxen knows about

    View Slide

  103. $ boxen
    # run it but include in the
    catalog automatically

    View Slide

  104. PROJECT MANIFESTS

    View Slide

  105. i want to hack on my project

    View Slide

  106. # modules/projects/manifests/team.pp
    class projects::team {
    boxen::project { 'team':
    dotenv => true,
    mysql => true,
    nginx => true,
    ruby => '1.9.3',
    source => 'github/team',
    }
    }

    View Slide

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

    View Slide

  108. cloned repo
    nginx vhost
    ruby version
    mysql databases
    .env file

    View Slide

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

    View Slide

  110. PERSONAL MANIFESTS

    View Slide

  111. i want to install $x but only for me

    View Slide

  112. # modules/people/manifests/wfarr.pp
    class people::wfarr {
    include minecraft
    }

    View Slide

  113. # modules/people/manifests/wfarr.pp
    class people::wfarr {
    include zsh
    }

    View Slide

  114. # modules/people/manifests/wfarr.pp
    class people::wfarr {
    case $::hostname {
    'bender': {
    include projects::all
    }
    'scruffy': {
    include projects::team
    }
    default: {}
    }
    }

    View Slide

  115. # 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]';
    }
    }

    View Slide

  116. # modules/people/manifests/wfarr.pp
    class people::wfarr {
    include osx::example_things
    }

    View Slide

  117. ISSUES

    View Slide

  118. $ boxen
    Error: 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.

    View Slide

  119. CODEZ

    View Slide

  120. CODEZ
    who failed

    View Slide

  121. CODEZ
    how long ago

    View Slide

  122. CODEZ machine

    View Slide

  123. CODEZ
    os version

    View Slide

  124. CODEZ shell

    View Slide

  125. CODEZ
    ref

    View Slide

  126. CODEZ
    compare view

    View Slide

  127. CODEZ
    git status

    View Slide

  128. CODEZ
    full command

    View Slide

  129. CODEZ
    full log

    View Slide

  130. i fix the error and run `boxen`

    View Slide

  131. CODEZ

    View Slide

  132. via issues api

    View Slide

  133. # config/boxen.rb
    ENV['BOXEN_REPO_NAME'] = \
    'github/boxen'
    ENV['BOXEN_ISSUES_ENABLED'] = 'yes'

    View Slide

  134. UPDATES

    View Slide

  135. $ boxen
    Boxen is up-to-date.

    View Slide

  136. $ boxen
    Boxen has a dirty tree, won't auto-
    update!

    View Slide

  137. $ boxen
    Boxen has unpushed commits on
    master, won't auto-update!

    View Slide

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

    View Slide

  139. i'm sold.

    View Slide

  140. View Slide

  141. what if i have
    problems?

    View Slide

  142. file issues

    View Slide

  143. irc.freenode.net

    View Slide

  144. be chuck yeager

    View Slide

  145. View Slide

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

    View Slide

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

    View Slide

  148. detail text

    View Slide


  149. wfarr
    come work with me on
    things like boxen

    View Slide

  150. CODEZ

    View Slide

  151. thanks

    View Slide

  152. speakerdeck.com/wfarr/
    boxen-puppetcamp-atl

    View Slide