Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
* * * * * ec2-describe-instances | grep ^INSTANCE | awk '{print $4}' > /etc/puppet/autosign.conf
class default_node {
package { 'apache2':
ensure => installed
service { 'apache2':
ensure => true,
enable => true,
require => Package['apache2'],
aptitude install puppetmaster
echo " puppet" >> /etc/hosts
import "classes/*"
node default {
include default_node
set -e -x
# Needed so that the aptitude/apt-get operations will not be interactive
export DEBIAN_FRONTEND=noninteractive
apt-get update && apt-get -y upgrade
# Find the current IP of the puppet master and make "puppet" point to it
puppet_master_ip=$(host | grep "has address" | head -1 | awk '{print $NF}')
echo $puppet_master_ip puppet >> /etc/hosts
aptitude -y install puppet
# Enable the puppet client
sed -i /etc/default/puppet -e 's/START=no/START=yes/'
service puppet restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment