The quickest way to get a new Rackspace server instance connected to a puppet master

puppetrackspace

Right now I

  • log into the new server
  • put the puppet master in /etc/hosts
  • install puppet
  • change "START" to "yes" in /etc/default/puppet
  • change "server" to puppet master name under [main]
  • run agent with –waitforcert
  • sign it over on the puppet master.

I'd like for this to be automated. The long-term goal is to easily scale up and down as resources are needed.

Best Answer

There are a lot of techniques you can apply to make this less work. I don't know Rackspace specifically, so some of this may not be possible, but you can take some ideas and leave others.

  1. Use machine images: Have a machine image ready that includes Puppet, your configuration and a key in /root/.ssh/authorized_keys from an automation master.
  2. Add callback: Set up something in /etc/init.d, /etc/rc.local or similiar to kick off an initial puppet run, then hit the automation and trigger a script that signs the certificate. The host should already be in a node declaration that matches, and a second configuration should trigger with 'waitforcert' set to 'true'.
  3. Use Puppet to clean up: Have a module that cleans up the entries from the above (root access ssh key, rc.local, etc.)