management systems for: • Finance // Bio-Tech // Start-ups // Advertising • Sysadmin since 1998 • Amazon EC2 for 5+ years & Puppet for 4+ years • Based in NYC 2 Saturday, April 28, 12
• Provision & classify new instances • Maintain • Configure, manage change • Servers perform their function • Inception • “We need new servers!” • Destroy • Servers are decommissioned 7 Saturday, April 28, 12
Install Puppet • msiexec.exe -i puppet.msi • Classify • Drop a fact onto the node • or... plug it into an ENC • Launch Instances • ~*~*API MAGIC*~*~ • Configure • puppet agent -t • (config finishes in one run because your code is AWESOME) 8 Saturday, April 28, 12
(unless they’re >2.7) • Use Gem, apt.puppetlabs.com, or build your own packages • Google for: FPM • Use Puppet Enterprise! • Don’t use Ruby 1.8.5 (RHEL 5) • Apache/Nginx and passenger (puppetmasterd is for dev!) • DNS is important for the Puppetmaster! 12 Saturday, April 28, 12
to your Puppet Master • Create a DNS CNAME entry • puppet.myfqdn.com => ec2-23-20-187-61.compute-1.amazonaws.com • For Others (Linode, Rackspace, et al.): • Your (future) nodes need to find puppet.myfqdn.com PROVISION A PUPPET MASTER 14 Saturday, April 28, 12
them for provisioning, not instance configuration • (It’s Puppet’s job to configure your servers) • Hopefully the tool you use has Puppet support • Depends on your workflow 20 Saturday, April 28, 12
https://help.ubuntu.com/community/CloudInit • StarCluster • puppet node bootstrap • Chef (yes, really...) • 3rd Party Management Platform • Your own custom tool that SSHs onto the instances 23 Saturday, April 28, 12
• Puppet is configured on your new instance • echo "pluginsync=true" >> /etc/puppet/puppet.conf • echo "certname=some_unique_id" >> /etc/puppet/puppet.conf • echo "server=puppet.myfqdn" >> /etc/puppet/puppet.conf • mkdir -p /etc/facter/facts.d • echo server_role=web > /etc/facter/facts.d/server_role.txt • Puppet is run for the first time • puppet agent -t 26 Saturday, April 28, 12
include role::db } default: { fail("Role is undefined") } } node /^db1(?:\.\w+)?\.myapp\.com$/ inherits 'basenode' { include mysql::server include users::admins include kitchen::sink } Do this: Not this (in the cloud) 36 Saturday, April 28, 12
/ Foreman • Run multiple Puppet Masters • One master per cluster, or application • One master per region • Build loosely-coupled systems • Your provisioning system should tag your instances • cluster, environment, server_role, etc... 39 Saturday, April 28, 12