SlideShare a Scribd company logo
It Sounded Good on Paper
Jeffery Smith
Manager, Site Reliability Engineering |GrubHub
@DarkAndNerdy
Bio - Jeff Smith
• Manager, Site Reliability
Engineering at GrubHub
• Yes, we are also hiring
• Yes, there is free food. Yes it’s
totally awesome to work here
Email: jsmith@grubhub.com
Twitter: @DarkAndNerdy
Blog: www.allthingsdork.com
The Puppet Timeline
Reduce the Pain Through Sharing
10 11 12 Tips on What We Did
Wrong
What Puppet Manages
Tip #1 - Minimize App Specific Config
• Drives up the number of roles to maintain
• Can slow down developers if they don’t also write
Puppet Code
• Pushes deployment responsibilities into Configuration
Management
Draw the line
• Deployment process should handle deployment type
tasks
• Your roles can be more generic, like “Tomcat Server”
or “Web Server” vs “Payroll_App_Server”
Tip #2 - Code Base Structure Matters
• Avoid doing too much in a module. It’s OK if your
module makes assumptions, just document them
include apache::install
include apache::config
apache::vhost { ‘website’:
ensure => installed
}
apache::vhost { ‘website’:
ensure => installed,
}
Assumes nothing Assumes Apache is Installed
Tip #2 - Code Base Structure Matters
• Use the modules/profiles/roles pattern - Gary Larizza
• A single code base regardless of environments
Tip #3 - Everyone is watching!
• Passwords in codebase
prevents you from sharing
• Will an auditor throw-up in
their mouth?
• That sense of shame you
feel is probably a real issue
Tip #4 - A Repo Per Module
• In a single Repository, versioning becomes
complicated
• Changes become inter-mingled
• Automated testing requires some inspection of
changes to save on test time.
Speaking of Testing
• Not all testing is valuable.
Basic Puppet operations
aren’t worth testing
• Keep tests fast or you’ll get
burned at 2am during an
emergency patch
Tip #5 - Never Hand Touch a Server
Always build the server from scratch, using Puppet only. If you make a single
change, destroy and rebuild.
Tip #6 - There are only 3 numbers
When writing your manifests, you should think of your resources in these terms
• 0 - This resource can never exist
• 1 - There can only ever be one of these resources
• Many - There will be 1 or more of these resources
If you think there’s only 2 of a thing, someone is secretly planning the 3rd
Tip #7 - Exported Resources are Evil
Not Entirely
• Attempt to solve the problem with PuppetDB Query
• Move the exported resource to a runtime config store
• If necessary, develop clear patterns for tagging
resources. It aids in collection
Tip #8 - Branching Strategies - Ugh
Gotchas with this approach
• Need to blow away develop branch and clone with
master semi-regularly
• Bad change can break all of pre-prod (OOPS)
• Merge conflicts in Develop that don’t exist in PROD
• Do you do PRs for Develop? Slows things down
Alternatives
• Separate Branch for each server environment?
• Need to keep in sync with master
• Makes knowledge of changes local to the SRE that
made them
• Always work off master
• Added risk
• Tons of trash commits
Tip #9 - Be realistic about your secrets
• Use Hiera eyaml - https://github.com/TomPoulton/
hiera-eyaml
• If you’re using JSON, get over it, convert to YAML and
use Hiera eyaml. https://www.npmjs.com/package/
yamljs
• Key distribution is still tricky
Your Rube Goldberg solution is useless if it ends in a plain text file being loaded
Key Distribution
• It sucks everywhere. You’re not alone
• Just because it sucks, doesn’t mean you can store
keys in Source Control
• Puppet File Server has some options
• Allow by IP address or hostname
• Distribution to Puppet Master varies :-(
Puppet File Server
[ssl_keys]
path /secure/ssl_keys
allow 10.160.10.100
deny *.testdomain.com
file { ‘/etc/httpd/keys/ssl.key’:
source => ‘puppet:///ssl_keys/ssl.key'
}
Tip #10 - Build Monitoring in Puppet
Find a Puppet module for Nagios or build one, but put your monitoring in Puppet
• Weird things happen in ALL environments
• One Sys Admins test environment is a developer’s
production environment
• Provisioning a new node and implementing monitoring
shouldn’t be two separate steps
Tip #11 - Stop Using ‘exec’
• Execs take the elegance and readability out of Puppet
Code, especially when executing shell scripts
• You probably don’t do a good job of only triggering the
exec when needed
• Congrats! Your script is idempotent……..but…
Tip #12 - Use Hiera
• CASE statements are often a code smell
• Hiera allows you to use the same code for all
environments
• Don’t be afraid of Hiera structures, but whatever you
do for the love of God don’t number them
Example Hiera Structure
• Nodes
• node/certname
• Environment
• <environment names>
• DataCenter
• <datacenters>
• Performance Profile
• local, integration, staging, prod
• Globals
THANKS!
Email: jsmith@grubhub.com
Twitter: @DarkAndNerdy
Blog: www.allthingsdork.com

More Related Content

PPTX
Django strategy-test
PDF
DjangoCon 2013 - How to Write Fast and Efficient Unit Tests in Django
PDF
DevOps: Getting Started with Puppet on Windows
PDF
Drupal 7 ci and testing
PPTX
Bootstrapping Quality
KEY
Continuous Integration, the minimum viable product
PPTX
Automate Everything! (No stress development/Tallinn)
ODP
Give A Great Tech Talk 2013
Django strategy-test
DjangoCon 2013 - How to Write Fast and Efficient Unit Tests in Django
DevOps: Getting Started with Puppet on Windows
Drupal 7 ci and testing
Bootstrapping Quality
Continuous Integration, the minimum viable product
Automate Everything! (No stress development/Tallinn)
Give A Great Tech Talk 2013

What's hot (20)

PPTX
The Five Stages of Chef Grief: My First 6 months with Chef, and Getting Aroun...
PDF
Continuous Deployment at Etsy: A Tale of Two Approaches
PPTX
Speed = $$$
PPTX
Introduction to Test Driven Development
PPTX
Deployment taken seriously with Octopus Deploy and TeamCity
PDF
Automated testing with Cypress
PDF
8 Simple Rules for Consuming APIs
PDF
London Atlassian User Group - February 2014
PPT
Automating Software Releases (Dallas/Ft. Worth Perl Mongers 2004)
PDF
Drupalcamp Simpletest
PDF
Testing the way it should be
PDF
Octopus Deploy Tech Fest 2014
PDF
Continuous delivery of your legacy application
PDF
Mobile CI at Etsy
PPTX
Continuous Delivery with TFS msbuild msdeploy
PDF
Cypress testing
PDF
More Productivitiy with Spring Roo
PDF
Applying Chaos Engineering to Build Resilient Serverless Applications
PDF
Development, Deployment and Collaboration at Etsy
PDF
Selenium: What Is It Good For
The Five Stages of Chef Grief: My First 6 months with Chef, and Getting Aroun...
Continuous Deployment at Etsy: A Tale of Two Approaches
Speed = $$$
Introduction to Test Driven Development
Deployment taken seriously with Octopus Deploy and TeamCity
Automated testing with Cypress
8 Simple Rules for Consuming APIs
London Atlassian User Group - February 2014
Automating Software Releases (Dallas/Ft. Worth Perl Mongers 2004)
Drupalcamp Simpletest
Testing the way it should be
Octopus Deploy Tech Fest 2014
Continuous delivery of your legacy application
Mobile CI at Etsy
Continuous Delivery with TFS msbuild msdeploy
Cypress testing
More Productivitiy with Spring Roo
Applying Chaos Engineering to Build Resilient Serverless Applications
Development, Deployment and Collaboration at Etsy
Selenium: What Is It Good For
Ad

Viewers also liked (8)

PDF
Starting with c
PDF
Call# training
PDF
2015 Customer Service Initiative
PDF
Finding what you need
PDF
Thc training news
DOC
00001583
PDF
DevOps: What's Buried in the Fine Print
PDF
Brainstorming failure
Starting with c
Call# training
2015 Customer Service Initiative
Finding what you need
Thc training news
00001583
DevOps: What's Buried in the Fine Print
Brainstorming failure
Ad

Similar to It Sounded Good on Paper - Lessons Learned with Puppet (20)

PDF
Improving Operations Efficiency with Puppet
PDF
Using Puppet in Small Infrastructures
PDF
Creating a mature puppet system
PDF
Creating a Mature Puppet System
PPTX
Puppet Camp Silicon Valley 2015: How TubeMogul reached 10,000 Puppet Deployme...
PPTX
Puppetizing Your Organization
PDF
From SaltStack to Puppet and beyond...
PDF
Puppet for Sys Admins
PDF
Puppet for SysAdmins
PPT
Rapid scaling in_the_cloud_with_puppet
PDF
Puppet overview
PDF
20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...
PPT
State of Puppet 2013 - Puppet Camp DC
PDF
One-Man Ops
PDF
Test driven infrastructure development (2 - puppetconf 2013 edition)
PDF
Puppet Development Workflow
PDF
PuppetConf 2017: No Server Left Behind - Miguel Di Ciurcio Filho, Instruct
PDF
Intro to-puppet
PPT
vBACD - Introduction to Puppet, Configuration Management and IT Automation So...
PDF
Steamlining your puppet development workflow
Improving Operations Efficiency with Puppet
Using Puppet in Small Infrastructures
Creating a mature puppet system
Creating a Mature Puppet System
Puppet Camp Silicon Valley 2015: How TubeMogul reached 10,000 Puppet Deployme...
Puppetizing Your Organization
From SaltStack to Puppet and beyond...
Puppet for Sys Admins
Puppet for SysAdmins
Rapid scaling in_the_cloud_with_puppet
Puppet overview
20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...
State of Puppet 2013 - Puppet Camp DC
One-Man Ops
Test driven infrastructure development (2 - puppetconf 2013 edition)
Puppet Development Workflow
PuppetConf 2017: No Server Left Behind - Miguel Di Ciurcio Filho, Instruct
Intro to-puppet
vBACD - Introduction to Puppet, Configuration Management and IT Automation So...
Steamlining your puppet development workflow

Recently uploaded (20)

PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Spectroscopy.pptx food analysis technology
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Programs and apps: productivity, graphics, security and other tools
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Big Data Technologies - Introduction.pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Machine learning based COVID-19 study performance prediction
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
Spectroscopy.pptx food analysis technology
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Reach Out and Touch Someone: Haptics and Empathic Computing
Encapsulation_ Review paper, used for researhc scholars
Programs and apps: productivity, graphics, security and other tools
“AI and Expert System Decision Support & Business Intelligence Systems”
Review of recent advances in non-invasive hemoglobin estimation
Unlocking AI with Model Context Protocol (MCP)
MYSQL Presentation for SQL database connectivity
Big Data Technologies - Introduction.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Machine learning based COVID-19 study performance prediction
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx

It Sounded Good on Paper - Lessons Learned with Puppet

  • 1. It Sounded Good on Paper Jeffery Smith Manager, Site Reliability Engineering |GrubHub @DarkAndNerdy
  • 2. Bio - Jeff Smith • Manager, Site Reliability Engineering at GrubHub • Yes, we are also hiring • Yes, there is free food. Yes it’s totally awesome to work here Email: jsmith@grubhub.com Twitter: @DarkAndNerdy Blog: www.allthingsdork.com
  • 4. Reduce the Pain Through Sharing 10 11 12 Tips on What We Did Wrong
  • 6. Tip #1 - Minimize App Specific Config • Drives up the number of roles to maintain • Can slow down developers if they don’t also write Puppet Code • Pushes deployment responsibilities into Configuration Management
  • 7. Draw the line • Deployment process should handle deployment type tasks • Your roles can be more generic, like “Tomcat Server” or “Web Server” vs “Payroll_App_Server”
  • 8. Tip #2 - Code Base Structure Matters • Avoid doing too much in a module. It’s OK if your module makes assumptions, just document them include apache::install include apache::config apache::vhost { ‘website’: ensure => installed } apache::vhost { ‘website’: ensure => installed, } Assumes nothing Assumes Apache is Installed
  • 9. Tip #2 - Code Base Structure Matters • Use the modules/profiles/roles pattern - Gary Larizza • A single code base regardless of environments
  • 10. Tip #3 - Everyone is watching! • Passwords in codebase prevents you from sharing • Will an auditor throw-up in their mouth? • That sense of shame you feel is probably a real issue
  • 11. Tip #4 - A Repo Per Module • In a single Repository, versioning becomes complicated • Changes become inter-mingled • Automated testing requires some inspection of changes to save on test time.
  • 12. Speaking of Testing • Not all testing is valuable. Basic Puppet operations aren’t worth testing • Keep tests fast or you’ll get burned at 2am during an emergency patch
  • 13. Tip #5 - Never Hand Touch a Server Always build the server from scratch, using Puppet only. If you make a single change, destroy and rebuild.
  • 14. Tip #6 - There are only 3 numbers When writing your manifests, you should think of your resources in these terms • 0 - This resource can never exist • 1 - There can only ever be one of these resources • Many - There will be 1 or more of these resources If you think there’s only 2 of a thing, someone is secretly planning the 3rd
  • 15. Tip #7 - Exported Resources are Evil Not Entirely • Attempt to solve the problem with PuppetDB Query • Move the exported resource to a runtime config store • If necessary, develop clear patterns for tagging resources. It aids in collection
  • 16. Tip #8 - Branching Strategies - Ugh
  • 17. Gotchas with this approach • Need to blow away develop branch and clone with master semi-regularly • Bad change can break all of pre-prod (OOPS) • Merge conflicts in Develop that don’t exist in PROD • Do you do PRs for Develop? Slows things down
  • 18. Alternatives • Separate Branch for each server environment? • Need to keep in sync with master • Makes knowledge of changes local to the SRE that made them • Always work off master • Added risk • Tons of trash commits
  • 19. Tip #9 - Be realistic about your secrets • Use Hiera eyaml - https://github.com/TomPoulton/ hiera-eyaml • If you’re using JSON, get over it, convert to YAML and use Hiera eyaml. https://www.npmjs.com/package/ yamljs • Key distribution is still tricky Your Rube Goldberg solution is useless if it ends in a plain text file being loaded
  • 20. Key Distribution • It sucks everywhere. You’re not alone • Just because it sucks, doesn’t mean you can store keys in Source Control • Puppet File Server has some options • Allow by IP address or hostname • Distribution to Puppet Master varies :-(
  • 21. Puppet File Server [ssl_keys] path /secure/ssl_keys allow 10.160.10.100 deny *.testdomain.com file { ‘/etc/httpd/keys/ssl.key’: source => ‘puppet:///ssl_keys/ssl.key' }
  • 22. Tip #10 - Build Monitoring in Puppet Find a Puppet module for Nagios or build one, but put your monitoring in Puppet • Weird things happen in ALL environments • One Sys Admins test environment is a developer’s production environment • Provisioning a new node and implementing monitoring shouldn’t be two separate steps
  • 23. Tip #11 - Stop Using ‘exec’ • Execs take the elegance and readability out of Puppet Code, especially when executing shell scripts • You probably don’t do a good job of only triggering the exec when needed • Congrats! Your script is idempotent……..but…
  • 24. Tip #12 - Use Hiera • CASE statements are often a code smell • Hiera allows you to use the same code for all environments • Don’t be afraid of Hiera structures, but whatever you do for the love of God don’t number them
  • 25. Example Hiera Structure • Nodes • node/certname • Environment • <environment names> • DataCenter • <datacenters> • Performance Profile • local, integration, staging, prod • Globals