"Functional Hostnames and Why they are Bad" by Andrew Fong and Gary Josack of Dropbox at Puppet Camp SF 2013. Find a Puppet Camp near you and learn more about configuration management: puppetlabs.com/community/puppet-camp/
2. What’s in a name?
Andrew Fong and Gary Josack
fong@dropbox.com
gary@dropbox.com
3. About Dropbox
• Thousands of instances/servers
• Mostly Python Stack
• EC2 and Large Self Datacenters
• Over a billion file syncs per day
• Thousands of MySQL Shards
• 4 SREs and 1 DBA
8. My First Puppet Config
Node ‘mickey.hostapuppet.com’ {
include common
include webserver
include sudoers
}
Node ‘donald.hostapuppet.com’{
include common
include db
include sudoers
}
14. Hosttypes
$hosttype = inline_template('<%= hostname.sub(/w+-([a-z]+)d*/){$1} %>’)
if $hosttype == ‘web’ { if $hosttype == ‘api’ {
include sudoers include sudoers
include web include api
}
}
If $hosttype == ‘db’ {
include sudoers
include db
}
15. Back to sudoers
…
file { "/etc/sudoers":
owner => root,
group => root,
mode => "440",
source => "puppet:///modules/sudo/sudoers",
}
…
16. Sudoers File itself
Host_Alias WEB=sjc-web*
Host_Alias DB=sjc-db*
Host_Alias API=sjc-api*
database_guy DB=(all) NOPASSWD: ALL
ops_guy WEB=(all) NOPASSWD: ALL
api_team API=(all) NOPASSWD: ALL
18. Chapter 3: An Expanding
Infrastructure
• Lots of new hires!
• A bunch more developers
• Some PMs
• Some Designers
19. All Kinds Of Problems…
• Boxes of same hardware class running
different services
• Boxes serving more than one role
(remember sudoers?)
• Deploying or moving hosts quickly
20. Renaming a host
• Update dns
• Update dhcpd.conf
• Push both
• Update puppet configs
• Update code
37. Provisioning
• Preload MDB, DNS, DHCPD, etc.
- Set it and forget it
• Have spares ready for any roles
• Assigning a role is one command
• No more renames!