Skip to content

Instantly share code, notes, and snippets.

@abyx
Created December 19, 2010 19:24
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save abyx/747614 to your computer and use it in GitHub Desktop.
Save abyx/747614 to your computer and use it in GitHub Desktop.
* * * * * 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 "127.0.0.1 puppet" >> /etc/hosts
import "classes/*"
node default {
include default_node
}
#!/bin/bash
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 my_puppet_master.company.com | 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