Skip to content

Instantly share code, notes, and snippets.

@chadh
Created October 18, 2015 16:06
Show Gist options
  • Select an option

  • Save chadh/b1003452652fb6dbb262 to your computer and use it in GitHub Desktop.

Select an option

Save chadh/b1003452652fb6dbb262 to your computer and use it in GitHub Desktop.
#!/bin/bash
export PATH="/sbin:/bin:/usr/sbin:/usr/bin"
readonly APTOPTS='-o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold"'
function install_puppet() {
pushd /root > /dev/null
wget http://apt.puppetlabs.com/puppetlabs-release-wheezy.deb
dpkg -i puppetlabs-release-wheezy.deb
apt-get update
apt-get -y ${APTOPTS} install puppet
popd > /dev/null
}
function install_firstboot() {
cat <<EOF > /etc/init.d/localfirstboot
### BEGIN INIT INFO
# Provides localfirstboot
# Required-Start: networking
# Default-Start: 3
# Short-Description: Script run after very first boot
# Description: Script to configure system after initial boot
### END INIT INFO
puppet agent --test --debug --pluginsync --server parmigiano.cc.gatech.edu --environment infrastructure
update-rc.d localfirst boot disable
EOF
update-rc.d localfirstboot enable
}
install_puppet
install_firstboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment