Installing Puppet Dashboard on Debian Wheezy

installation

Get the latest version of Puppet Dashboard from the puppetlabs site, install dependecies and install the Puppet Dashboard package.

wget http://apt.puppetlabs.com/pool/wheezy/main/p/puppet-dashboard/puppet-dashboard_1.2.23-1puppetlabs1_all.deb
sudo apt-get install rake dbconfig-common libdbd-mysql-ruby libhttpclient-ruby1.8 mysql-server libapache2-mod-passenger
sudo dpkg -i puppet-dashboard_1.2.23-1puppetlabs1_all.deb

configuration

Create the databases and user for puppet dashboard.

sudo mysql --defaults-file=/etc/mysql/debian.cnf -Bse 'CREATE DATABASE dashboard_production CHARACTER SET utf8;'
sudo mysql --defaults-file=/etc/mysql/debian.cnf -Bse 'CREATE DATABASE dashboard_development CHARACTER SET utf8;'
sudo mysql --defaults-file=/etc/mysql/debian.cnf -Bse 'CREATE DATABASE dashboard_test CHARACTER SET utf8;'
sudo mysql --defaults-file=/etc/mysql/debian.cnf -Bse "CREATE USER 'dashboard'@'localhost' IDENTIFIED BY 'verysecretpassword';"
sudo mysql --defaults-file=/etc/mysql/debian.cnf -Bse "GRANT ALL PRIVILEGES ON dashboard_production.* TO 'dashboard'@'localhost';"
sudo mysql --defaults-file=/etc/mysql/debian.cnf -Bse "GRANT ALL PRIVILEGES ON dashboard_test.* TO 'dashboard'@'localhost';"
sudo mysql --defaults-file=/etc/mysql/debian.cnf -Bse "GRANT ALL PRIVILEGES ON dashboard_development.* TO 'dashboard'@'localhost';"

Next, edit /etc/puppet-dashboard/database.yml to make sure it contains the password we just set. In this example verysecretpassword. Edit the mysql configuration file /etc/mysql/my.conf to make sure the setting max_allowed_packet is 32M or more.

Change directory to the location where Puppet Dashboard is installed and run the rake tesk to fill the database we just created.

cd /usr/share/puppet-dashboard/
sudo rake RAILS_ENV=production db:migrate

Make sure the webserver can write to the log files

sudo chown www-data.www-data /usr/share/puppet-dashboard/log/*

Start the Puppet Dashboard WEBrick server

sudo -u www-data ./script/server -e production

You should now be able to access the Puppet Dashboard webinterface on port 3000 of your server. http://yourservernemeoripaddress:3000/

Passenger

The WEBrick server is fine for testing, but not for production. Hence we run Puppet Dashboard with the Apache webserver.

Stop the running WEBrick server with crtl+c and copy the example config file to the apache vHosts directory and enable the vHost.

sudo cp /usr/share/puppet-dashboard/ext/passenger/dashboard-vhost.conf /etc/apache2/sites-available/puppet-dashboard
sudo a2ensite puppet-dashboard

Edit /etc/apache2/sites-enabled/puppet-dashboard to match following. Don't forget to change ServerName.

PassengerRuby /usr/bin/ruby1.8

PassengerHighPerformance on
PassengerMaxPoolSize 12
PassengerPoolIdleTime 1500
PassengerStatThrottleRate 120

<VirtualHost *:80>
        SetEnv RAILS_ENV production
        RailsBaseURI /
        ServerName puppet.YOURSERVERNAME.ext
        DocumentRoot /usr/share/puppet-dashboard/public/
        <Directory /usr/share/puppet-dashboard/public/>
                Options None
                AllowOverride AuthConfig
                Order allow,deny
                allow from all
        </Directory>
  ErrorLog /var/log/apache2/puppet-dashboard_error.log
  LogLevel warn
  CustomLog /var/log/apache2/puppet-dashboard_access.log combined
  ServerSignature On
</VirtualHost>

Restart Apache to load our configuration.

sudo service apache2 restart

Open a webbrowser and go to the url you chose with the ServerName directive. Goto http://docs.puppetlabs.com/dashboard/manual/1.2/bootstrapping.html#configuring-puppet and configure ?PuppetMaster to communicate with Puppet Dashboard.

Happy Puppeting!


CategorySystemAdministration