Puppet Dashboard

The Puppet Dashboard is a useful tool, that gives a birds-eye view of your systems configurations. You can see all errors being reported in a single place, as well as nodes that have stopped reporting. Here is how to set it up.

This picks up after the CentOS puppet install tutorial.

Install MySQL Server
The puppet dashboard stores data in a mysql database, so lets install it, start it and set a root mysql password. Here we’re using “motorrobot” for the password.

yum -y install mysql-server
/etc/init.d/mysqld start
/usr/bin/mysqladmin -uroot password 'motorrobot' 

Create database for puppet dashboard

We’ll create a database called puppetdash and a user called puppdash with a password of motorrobot to connect to it.

echo "create database puppetdash;" | mysql -uroot -pmotorrobot
echo "grant all privileges on puppetdash.* to puppetdash@localhost identified by 'motorrobot';" | mysql -uroot -pmotorrobot
echo "flush privileges;" | mysql -uroot -pmotorrobot 


Setup puppetlabs Yum repository

rpm -ivh http://yum.puppetlabs.com/el/6/products/x86_64/puppetlabs-release-6-1.noarch.rpm

Install puppet-dashboard RPM

yum -y install puppet-dashboard

Copy and edit the settings file, and database configuration files

cp /usr/share/puppet-dashboard/config/settings.yml.example /usr/share/puppet-dashboard/config/settings.yml
nano -w /usr/share/puppet-dashboard/config/database.yml

Make the file look like this.

production:
database: puppetdash
username: puppdash
password: motorrobot
encoding: utf8
adapter: mysql
development:
database: puppetdash
username: puppdash
password: motorrobot
encoding: utf8
adapter: mysql

Migrate the DB similar to other Ruby on Rails apps

Then start the dashboard service, which by default runs on port 3000.

cd /usr/share/puppet-dashboard
rake db:migrate
/etc/init.d/puppet-dashboard start

Add Reporting to puppet.conf

echo " report = true" >> /etc/puppet/puppet.conf
echo "" >> /etc/puppet/puppet.conf
echo "[master]" >> /etc/puppet/puppet.conf
echo " reports = store, http" >> /etc/puppet/puppet.conf
echo " reporturl = http://192.168.7.2:3000/reports/upload" >> /etc/puppet/puppet.conf

Run Puppet manually, and Set Services to start at boot

puppetd -t
chown puppet-dashboard /usr/share/puppet-dashboard/log/
/sbin/chkconfig puppet-dashboard on
/sbin/chkconfig puppet-dashboard-workers on
/sbin/chkconfig mysqld on
/etc/init.d/puppet-dashboard restart
/etc/init.d/puppet-dashboard-workers restart

If all went well you should see something like this.

(Comments)

Comments