Skip to content

Instantly share code, notes, and snippets.

@andys
Created November 18, 2010 07:15
Show Gist options
  • Save andys/704716 to your computer and use it in GitHub Desktop.
Save andys/704716 to your computer and use it in GitHub Desktop.
Steps for installing puppet master in Ubuntu 10.04 with ruby 1.8 and passenger
Puppet Install steps for Ubuntu 10.04, ruby 1.8, and passenger
apt-get -y update
apt-get -y dist-upgrade
reboot
############################################
apt-get -y install build-essential
apt-get -y install bsubversion apache2 libcurl4-openssl-dev libssl-dev mysql-server
apt-get -y install zlib1g-dev apache2-prefork-dev libapr1-dev libaprutil1-dev
apt-get -y install ruby ruby-dev libxmlrpc-ruby libopenssl-ruby libshadow-ruby1.8 irb rdoc libopenssl-ruby1.8 libruby
wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz
tar -xvzf rubygems*z
cd rubygems-1.3.7
ruby setup.rb
ln -s /usr/bin/gem1.8 /usr/bin/gem
cd ..
gem update --system
gem install rails --version 2.3.8 --no-ri --no-rdoc
gem install puppet --version 2.6.2
gem install passenger --version 3.0.0
gem install rack
gem install mysql
passenger-install-apache2-module -a
cd /etc
mv puppet puppet.orig
cat <<EOF > /etc/apache2/sites-available/default
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-3.0.0/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-3.0.0
PassengerRuby /usr/bin/ruby1.8
Listen *:8140
<VirtualHost *:8140 >
SSLEngine on
SSLCipherSuite SSLv2:-LOW:-EXPORT:RC4+RSA
SSLCertificateFile /var/lib/puppet/ssl-master/certs/puppetmaster.pem
SSLCertificateKeyFile /var/lib/puppet/ssl-master/private_keys/puppetmaster.pem
SSLCertificateChainFile /var/lib/puppet/ssl-master/ca/ca_crt.pem
SSLCACertificateFile /var/lib/puppet/ssl-master/ca/ca_crt.pem
SSLVerifyClient optional
SSLVerifyDepth 1
SSLOptions +StdEnvVars
RequestHeader set X-SSL-Subject %{SSL_CLIENT_S_DN}e
RequestHeader set X-Client-DN %{SSL_CLIENT_S_DN}e
RequestHeader set X-Client-Verify %{SSL_CLIENT_VERIFY}e
PassengerPoolIdleTime 300
PassengerMaxPoolSize 15
PassengerUseGlobalQueue on
PassengerHighPerformance on
ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /var/log/apache2/access.log combined
RackAutoDetect On
DocumentRoot /etc/puppet/rack/public/
<Directory /etc/puppet/rack>
Options None
AllowOverride None
Order allow,deny
allow from all
</Directory>
</VirtualHost>
EOF
useradd puppet -d /var/lib/puppet -s /bin/false
puppetd --test --no-client
############################################
# Stop here and fill in /var/lib/puppet/ssl-master
# either restore backups of your certificates, or run ???
mkdir /etc/puppet/rack
mkdir /etc/puppet/rack/public
chmod 755 /etc/puppet/rack
chmod 755 /etc/puppet/rack/public
cp /usr/lib/ruby/gems/1.8/gems/puppet-2.6.2/ext/rack/files/config.ru /etc/puppet/rack/config.ru
mkdir /var/lib/puppet/server_data
chmod 750 /var/lib/puppet/server_data
chown -Rf puppet:puppet /etc/puppet
chown -Rf puppet:puppet /var/lib/puppet
chown puppet:puppet /var/log/puppet/
# In mysql:
CREATE USER 'puppet'@'localhost' IDENTIFIED BY 'Pupp3t!';
CREATE DATABASE puppet;
GRANT ALL PRIVILEGES ON *.* TO 'puppet '@'localhost';
FLUSH PRIVILEGES;
a2enmod ssl
a2enmod headers
/etc/init.d/apache2 restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment