Skip to content

Instantly share code, notes, and snippets.

@jmetzger
Last active October 11, 2016 10:40
Show Gist options
  • Save jmetzger/9e5e9208038f45c748dc to your computer and use it in GitHub Desktop.
Save jmetzger/9e5e9208038f45c748dc to your computer and use it in GitHub Desktop.
puppet-debian-etch-installer
#!/bin/bash
###
# This script install puppet version 3.7 (or better latest) on debian etch
MAJOR_VERSION=$(cat /etc/debian_version | cut -d'.' -f 1)
if [ $MAJOR_VERSION -ne 4 ]
then
echo "Sorry, this is not Debian Etch (4), Giving up"
exit
fi
if [ ! -f /etc/apt/sources.list.d/debian-backports ]
then
echo "deb http://archive.debian.org/debian-backports etch-backports main" > /etc/apt/sources.list.d/backports.list
apt-get -q update
# install the backports keyring
apt-get -y --force-yes install debian-backports-keyring
fi
# next step install ruby 1.8
apt-get -y install -t etch-backports libruby1.8 ruby1.8 rdoc1.8 irb1.8
RUBY=$(which ruby1.8)
# now install wget - if it is not present yet
apt-get -y install wget
if [ -d /usr/src/rubygems-2.4.4 ]
then
# download rubygems
cd /usr/src; wget http://production.cf.rubygems.org/rubygems/rubygems-2.4.4.tgz -O /usr/src/rubygems.tar.gz
tar xzvf rubygems.tar.gz
fi
cd /usr/src/rubygems-2.4.4
$RUBY setup.rb
GEMS=$(which gem1.8)
if [ "$GEMS" == "" ]
then
echo "Sorry, somehow no gem - package was installed, giving up"
exit
fi
#
# now update the gems
$GEMS update --system
# $GEMS install puppet did not work
# so I did
aptitude -y install ruby rubygems
mv /usr/bin/gem /usr/bin/gem-old
ln -s /usr/bin/gem1.8 /usr/bin/gem
# <- I assume the most important thing is to link /usr/bin/gem -> /usr/bin/gem-1.9
# now install pup
gem install puppet
# I ended up with a running puppet 3.7.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment