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. what is boxen?

    View full-size slide

  2. @jbarnette + @wfarr

    View full-size slide

  3. developing software is
    harder than it used to be

    View full-size slide

  4. our toolchains have gotten
    more robust

    View full-size slide

  5. our toolchains have gotten
    more complicated

    View full-size slide

  6. want to work on $anything?

    View full-size slide

  7. 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 full-size slide

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

    View full-size slide

  9. let's make it better

    View full-size slide

  10. THINGS BOXEN IS

    View full-size slide


  11. a framework

    View full-size slide

  12. THINGS BOXEN IS NOT

    View full-size slide

  13. why should i use
    boxen?

    View full-size slide

  14. FRICTION SUCKS

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  18. "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 full-size slide

  19. "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 full-size slide

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

    View full-size slide

  21. USS COOL STUFF

    View full-size slide

  22. INCONSISTENCY SUCKS

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  26. manual audits are
    tedious

    View full-size slide

  27. manual audits are
    error-prone

    View full-size slide

  28. ask software instead of humans

    View full-size slide

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

    View full-size slide

  30. UPDATING SUCKS

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  34. SECURITY SUCKS

    View full-size slide

  35. security is a war of attrition

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  40. no surprises

    View full-size slide

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

    View full-size slide

  42. what do i get?

    View full-size slide

  43. boxen is run via some ruby

    View full-size slide

  44. it collects info for facter

    View full-size slide

  45. it checks for prerequisites and
    conflicts before each run

    View full-size slide

  46. it detects certain changes post-run

    View full-size slide

  47. it has hooks too

    View full-size slide

  48. 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 full-size slide

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

    View full-size slide

  50. package: homebrew,
    compressed_app

    View full-size slide

  51. repository: git

    View full-size slide

  52. service: ghlaunchd

    View full-size slide

  53. "the library"

    View full-size slide

  54. 130+ modules on GitHub

    View full-size slide

  55. GitHub uses ~81 of those

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  58. PUPPET-TEMPLATE

    View full-size slide

  59. example module using cardboard

    View full-size slide

  60. template boxen project

    View full-size slide

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

    View full-size slide

  62. how do i get it?

    View full-size slide

  63. Automate Everything

    View full-size slide

  64. boxen/boxen-web

    View full-size slide

  65. how do i use it?

    View full-size slide

  66. $ boxen
    # run it

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  69. PROJECT MANIFESTS

    View full-size slide

  70. i want to hack on my project

    View full-size slide

  71. # 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 full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  75. PERSONAL MANIFESTS

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  80. # 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 full-size slide

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

    View full-size slide

  82. $ 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 full-size slide

  83. CODEZ
    who failed

    View full-size slide

  84. CODEZ
    how long ago

    View full-size slide

  85. CODEZ machine

    View full-size slide

  86. CODEZ
    os version

    View full-size slide

  87. CODEZ
    compare view

    View full-size slide

  88. CODEZ
    git status

    View full-size slide

  89. CODEZ
    full command

    View full-size slide

  90. CODEZ
    full log

    View full-size slide

  91. i fix the error and run `boxen`

    View full-size slide

  92. via issues api

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  98. what if i have
    problems?

    View full-size slide

  99. file issues

    View full-size slide

  100. irc.freenode.net

    View full-size slide

  101. be chuck yeager

    View full-size slide

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

    View full-size slide

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

    View full-size slide


  104. wfarr
    come work with me on
    things like boxen

    View full-size slide

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

    View full-size slide