Project

General

Profile

Feature #176

Installing Puppet Dashboard on Debian 7

Added by Daniel Curtis about 7 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Automated Server Management
Target version:
-
Start date:
08/20/2013
Due date:
% Done:

100%

Estimated time:
1.00 h
Spent time:

Description

  • 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
    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/databse.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 test 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://puppet.example.com: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.
    Listen 3000
    PassengerRuby /usr/bin/ruby
    PassengerHighPerformance on
    PassengerMaxPoolSize 12
    PassengerPoolIdleTime 1500
    PassengerStatThrottleRate 120
    
    <VirtualHost *:3000>
            SetEnv RAILS_ENV production
            RailsBaseURI /
            ServerName puppet.example.com
            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.

Note: I had to add a Listen directive to the vHost configuration, as the server would not automatically listen on the configured port and I did not set the Puppet Dashboard on the default port 80.

Resources

History

#1 Updated by Daniel Curtis about 7 years ago

  • Description updated (diff)

#2 Updated by Daniel Curtis over 5 years ago

  • Description updated (diff)

#3 Updated by Daniel Curtis over 5 years ago

  • Project changed from 30 to GNU/Linux Administration
  • Category set to Automated Server Management

Also available in: Atom PDF