Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

The Seven Habits of Highly Effective Puppet Users - PuppetConf 2014

3,527 views

Published on

The Seven Habits of Highly Effective Puppet Users - David Danzilio, Constant Contact

Published in: Technology

The Seven Habits of Highly Effective Puppet Users - PuppetConf 2014

  1. 1. Seven Habits of Highly Effective Puppet Users David Danzilio @djdanzilio 1
  2. 2. $(whoami) 2
  3. 3. What’s talk this about?
  4. 4. A collection of observations of high performing Puppet users
  5. 5. Habits?
  6. 6. What’s a habit?
  7. 7. “[A habit is] an acquired behavior pattern regularly followed until it has become almost involuntary”
  8. 8. Habits are hard
  9. 9. You don’t think about habits
  10. 10. Seven Habits • Think like a software developer • Treat Puppet like code • Stop, drop, and design • Test all the things • Continuous integration and deployment • Make nice with Ruby • Get involved
  11. 11. Seven Habits of Highly Effective Puppet Users Habit #1 Think like a software developer 14Habit 1: Think like a software developer
  12. 12. Seven Habits of Highly Effective Puppet Users You’re not a system administrator anymore 15Habit 1: Think like a software developer
  13. 13. Seven Habits of Highly Effective Puppet Users You’re a software developer 16Habit 1: Think like a software developer
  14. 14. Seven Habits of Highly Effective Puppet Users System Administration ≠ Software Development 18Habit 1: Think like a software developer
  15. 15. Seven Habits of Highly Effective Puppet Users Why did we think this would be easy?! 19Habit 1: Think like a software developer
  16. 16. Seven Habits of Highly Effective Puppet Users Puppet is easy because it’s a DSL 20Habit 1: Think like a software developer
  17. 17. FALSEFALSE
  18. 18. Seven Habits of Highly Effective Puppet Users We just made it easy to write bad code 22Habit 1: Think like a software developer
  19. 19. Seven Habits of Highly Effective Puppet Users You can’t expect people to be good at something they’ve never done 23Habit 1: Think like a software developer
  20. 20. I’m a doctor, not an engineer.I’m a doctor, not an engineer.24
  21. 21. Seven Habits of Highly Effective Puppet Users Software engineering is a mature discipline 25Habit 1: Think like a software developer
  22. 22. Seven Habits of Highly Effective Puppet Users This is particularly important in Puppet 4 26Habit 1: Think like a software developer
  23. 23. Seven Habits of Highly Effective Puppet Users Habit #2 Treat Puppet like code 27Habit 2: Treat Puppet like code
  24. 24. Seven Habits of Highly Effective Puppet Users Stop thinking of Puppet as just configuration data 28Habit 2: Treat Puppet like code
  25. 25. Seven Habits of Highly Effective Puppet Users Infrastructure as CODE 29Habit 2: Treat Puppet like code
  26. 26. Seven Habits of Highly Effective Puppet Users Infrastructure as CODE 30Habit 2: Treat Puppet like code
  27. 27. Seven Habits of Highly Effective Puppet Users Version Control 32Habit 2: Treat Puppet like code
  28. 28. Seven Habits of Highly Effective Puppet Users Documentation 34Habit 2: Treat Puppet like code
  29. 29. Seven Habits of Highly Effective Puppet Users README 36Habit 2: Treat Puppet like code
  30. 30. Seven Habits of Highly Effective Puppet Users Inline documentation 38Habit 2: Treat Puppet like code
  31. 31. Seven Habits of Highly Effective Puppet Users Refactoring 40Habit 2: Treat Puppet like code
  32. 32. ***
  33. 33. Seven Habits of Highly Effective Puppet Users Code Review 42Habit 2: Treat Puppet like code
  34. 34. Seven Habits of Highly Effective Puppet Users Style 43Habit 2: Treat Puppet like code
  35. 35. 44
  36. 36. Seven Habits of Highly Effective Puppet Users puppet-lint 45Habit 2: Treat Puppet like code
  37. 37. Seven Habits of Highly Effective Puppet Users Habit #3 Stop, drop, and design 46Habit 3: Stop, drop, and design
  38. 38. 47 **
  39. 39. Seven Habits of Highly Effective Puppet Users Software needs to be designed 48Habit 3: Stop, drop, and design
  40. 40. Seven Habits of Highly Effective Puppet Users Separation of Concerns 49Habit 3: Stop, drop, and design
  41. 41. Seven Habits of Highly Effective Puppet Users Package, File, Service 50Habit 3: Stop, drop, and design
  42. 42. Seven Habits of Highly Effective Puppet Users Roles and Profiles 51Habit 3: Stop, drop, and design
  43. 43. Seven Habits of Highly Effective Puppet Users Identify Interfaces 52Habit 3: Stop, drop, and design
  44. 44. Seven Habits of Highly Effective Puppet Users What information does your module need? 53Habit 3: Stop, drop, and design
  45. 45. Seven Habits of Highly Effective Puppet Users Where does that information come from? 54Habit 3: Stop, drop, and design
  46. 46. Seven Habits of Highly Effective Puppet Users Where does that information need to go? 55Habit 3: Stop, drop, and design
  47. 47. Seven Habits of Highly Effective Puppet Users Public and Private classes 56Habit 3: Stop, drop, and design
  48. 48. Seven Habits of Highly Effective Puppet Users Data Separation 57Habit 3: Stop, drop, and design
  49. 49. Seven Habits of Highly Effective Puppet Users Data in your Puppet code is bad 58Habit 3: Stop, drop, and design
  50. 50. Seven Habits of Highly Effective Puppet Users Hiera 59Habit 3: Stop, drop, and design
  51. 51. Seven Habits of Highly Effective Puppet Users params 60Habit 3: Stop, drop, and design
  52. 52. Seven Habits of Highly Effective Puppet Users Module data 61Habit 3: Stop, drop, and design
  53. 53. Seven Habits of Highly Effective Puppet Users Stability 62Habit 3: Stop, drop, and design
  54. 54. Seven Habits of Highly Effective Puppet Users Identify a stable feature set 63Habit 3: Stop, drop, and design
  55. 55. Seven Habits of Highly Effective Puppet Users Semantic Versioning 64Habit 3: Stop, drop, and design
  56. 56. Seven Habits of Highly Effective Puppet Users Simplicity 65Habit 3: Stop, drop, and design
  57. 57. Seven Habits of Highly Effective Puppet Users UNIX Philosophy 66Habit 3: Stop, drop, and design
  58. 58. Seven Habits of Highly Effective Puppet Users Focus on your module’s core functionality 67Habit 3: Stop, drop, and design
  59. 59. Seven Habits of Highly Effective Puppet Users Hooks 68Habit 3: Stop, drop, and design
  60. 60. Seven Habits of Highly Effective Puppet Users class jabberd ( ... $manage_package = true, $manage_repository = false, $manage_service = true, ... ) { ... } 69Habit 3: Stop, drop, and design
  61. 61. Seven Habits of Highly Effective Puppet Users Write modules as if they’re going to be open sourced 70Habit 3: Stop, drop, and design
  62. 62. Seven Habits of Highly Effective Puppet Users Habit #4 Test all the things 71Habit 4: Create a culture of testing
  63. 63. Seven Habits of Highly Effective Puppet Users The toolchain has improved dramatically 73Habit 4: Create a culture of testing
  64. 64. Seven Habits of Highly Effective Puppet Users Testing has become relatively inexpensive 74Habit 4: Create a culture of testing
  65. 65. Seven Habits of Highly Effective Puppet Users Your infrastructure is too important to not test 75Habit 4: Create a culture of testing
  66. 66. Seven Habits of Highly Effective Puppet Users How? 77Habit 4: Create a culture of testing
  67. 67. Seven Habits of Highly Effective Puppet Users puppet-syntax 78Habit 4: Create a culture of testing
  68. 68. Seven Habits of Highly Effective Puppet Users rspec-puppet 79Habit 4: Create a culture of testing
  69. 69. Seven Habits of Highly Effective Puppet Users describe ‘myclass’ do it { should compile.with_all_deps } end 80Habit 4: Create a culture of testing
  70. 70. Seven Habits of Highly Effective Puppet Users beaker 81Habit 4: Create a culture of testing
  71. 71. Seven Habits of Highly Effective Puppet Users 82Habit 4: Create a culture of testing kitchen-ci
  72. 72. Seven Habits of Highly Effective Puppet Users serverspec 83Habit 4: Create a culture of testing
  73. 73. Seven Habits of Highly Effective Puppet Users describe package('httpd') do it { should be_installed } end describe service('httpd') do it { should be_enabled } it { should be_running } end describe port(80) do it { should be_listening } end 84Habit 4: Create a culture of testing
  74. 74. Seven Habits of Highly Effective Puppet Users Why test Puppet? 85Habit 4: Create a culture of testing
  75. 75. Seven Habits of Highly Effective Puppet Users Complexity 86Habit 4: Create a culture of testing
  76. 76. Seven Habits of Highly Effective Puppet Users Test first! 88Habit 4: Create a culture of testing
  77. 77. Seven Habits of Highly Effective Puppet Users Make your tests count 89Habit 4: Create a culture of testing
  78. 78. Seven Habits of Highly Effective Puppet Users it do should contain_file(‘/etc/ssh/sshd_config’).with({ ‘ensure’ => ‘present’, ‘owner’ => ‘root’, ‘group’ => ‘root’, ‘mode’ => ‘0644’, }) end 91Habit 4: Create a culture of testing
  79. 79. Seven Habits of Highly Effective Puppet Users context ‘with port => 2222’ do let(:params) {{ :port => ‘2222’ }} it do should contain_file(‘/etc/ssh/sshd_config’).with_content( %r{Port 2222} ) end end 92Habit 4: Create a culture of testing
  80. 80. Seven Habits of Highly Effective Puppet Users Habit #5 Continuous Integration and Deployment 93Habit 5: Continuous integration and deployment
  81. 81. Seven Habits of Highly Effective Puppet Users Build a pipeline 94Habit 5: Continuous integration and deployment
  82. 82. Seven Habits of Highly Effective Puppet Users Automated testing 96Habit 5: Continuous integration and deployment
  83. 83. Seven Habits of Highly Effective Puppet Users Unit Tests 97Habit 5: Continuous integration and deployment
  84. 84. Seven Habits of Highly Effective Puppet Users Integration Tests 98Habit 5: Continuous integration and deployment
  85. 85. Seven Habits of Highly Effective Puppet Users Acceptance tests 99Habit 5: Continuous integration and deployment
  86. 86. Seven Habits of Highly Effective Puppet Users Test under real world conditions 100Habit 5: Continuous integration and deployment
  87. 87. Seven Habits of Highly Effective Puppet Users
  88. 88. Seven Habits of Highly Effective Puppet Users Puppet versions 103Habit 5: Continuous integration and deployment
  89. 89. Seven Habits of Highly Effective Puppet Users Operating System versions 104Habit 5: Continuous integration and deployment
  90. 90. Seven Habits of Highly Effective Puppet Users Ruby versions 105Habit 5: Continuous integration and deployment
  91. 91. Seven Habits of Highly Effective Puppet Users Dependency versions 106Habit 5: Continuous integration and deployment
  92. 92. Seven Habits of Highly Effective Puppet Users Automated deployment 107Habit 5: Continuous integration and deployment
  93. 93. Seven Habits of Highly Effective Puppet Users librarian-puppet, r10k, MCollective, Capistrano 108Habit 5: Continuous integration and deployment
  94. 94. Seven Habits of Highly Effective Puppet Users Habit #6 Make nice with Ruby 109Habit 6: Make nice with Ruby
  95. 95. Seven Habits of Highly Effective Puppet Users Puppet is Ruby 111Habit 6: Make nice with Ruby
  96. 96. Seven Habits of Highly Effective Puppet Users Get over it 112Habit 6: Make nice with Ruby
  97. 97. Seven Habits of Highly Effective Puppet Users Why? 114Habit 6: Make nice with Ruby
  98. 98. Seven Habits of Highly Effective Puppet Users rake 115Habit 6: Make nice with Ruby
  99. 99. Seven Habits of Highly Effective Puppet Users rspec 116Habit 6: Make nice with Ruby
  100. 100. Seven Habits of Highly Effective Puppet Users bundler 117Habit 6: Make nice with Ruby
  101. 101. Seven Habits of Highly Effective Puppet Users guard 118Habit 6: Make nice with Ruby
  102. 102. Seven Habits of Highly Effective Puppet Users Custom Types, Providers, and Facts 119Habit 6: Make nice with Ruby
  103. 103. Seven Habits of Highly Effective Puppet Users If you want to do anything advanced 120Habit 6: Make nice with Ruby
  104. 104. Seven Habits of Highly Effective Puppet Users Habit #7 Get involved 121Habit 7: Get involved
  105. 105. Seven Habits of Highly Effective Puppet Users Puppet is rapidly evolving 122Habit 7: Get involved
  106. 106. Seven Habits of Highly Effective Puppet Users Your experience is valuable 123Habit 7: Get involved
  107. 107. Seven Habits of Highly Effective Puppet Users Share your modules 124Habit 7: Get involved
  108. 108. Seven Habits of Highly Effective Puppet Users Speak at conferences 125Habit 7: Get involved
  109. 109. Seven Habits of Highly Effective Puppet Users Answer questions 126Habit 7: Get involved
  110. 110. Seven Habits of Highly Effective Puppet Users Blog about it 127Habit 7: Get involved
  111. 111. Questions?
  112. 112. Thank you!
  113. 113. David Danzilio @djdanzilio http://blog.danzilio.net
  114. 114. Image Credits • http://simpsons.wikia.com/wiki/File:Homer-simpson-brain,1280x800,18857.jpg • https://dcarchives.files.wordpress.com/2014/06/habit-change-1964-mcphee-priller.jpg • http://www.quickmeme.com/meme/3plfef • http://www.quickmeme.com/Bad-Habit-Bruce • http://www.mememaker.net/static/images/templates/747303.jpg • http://knowyourmeme.com/photos/230191-wtf-is-this-shit • http://programmerryangosling.tumblr.com/image/22790837971 • http://www.quickmeme.com/img/d3/d36ad81bae0a8d69cd91f81065d8b0a19d9dfc1b63753093992282d6aa8b35dd.jpg • http://www.avatar3trailer.com/gangnam-style/gangnam_style_psy_05.jpg • http://www.troll.me/images/pissed-off-obama/refactor-your-fucking-code.jpg • http://www.globalnerdy.com/2011/05/30/ruby-foo/ • http://www.quickmeme.com/meme/3twnp6 • http://smashingboxes.com/ideas/beginners-guide-to-test-driven-development-tdd • http://www.pythian.com/blog/service-reliability-how-systems-administration-is-evolving-part-one/ • http://www.troll.me/2012/03/07/uncategorized/dont-worry-guys-i-got-programmer-cred/ • http://www.savthecoder.com/blog/saturday-meme-5-futurama-fry-tests-his-new-method • http://www.quickmeme.com/meme/3uc80p/ • http://i.qkme.me/3tde6j.jpg • http://i.qkme.me/3sekdw.jpg • http://www.quickmeme.com/meme/3sm9k1?id=229466593 • http://i.ytimg.com/vi/HUSSKWWg-0c/maxresdefault.jpg • http://blog.15five.com/wp-content/uploads/2013/09/Hypnosis_for_bad_habits_nyc.jpg • http://www.keepcalm-o-matic.co.uk/p/keep-calm-and-rtfm-27/

×