Part 3: Installing puppet-dashboard on CentOS / Puppet 2.6.1
Puppet Dashboard
Puppet dashboard is a fairly new app with loads of future potential and is great for monitoring your puppet estate. This is a quick guide to getting it running on puppet 2.6.1. Be sure you have the correct yum repos and ruby versions installed, see Part 1 and Part 2 for more details.
Install the puppet-dashboard package.
punch# yum --enablerepo=puppetlabs,ruby,epel install puppet-dashboard [...] Installing for dependencies: mysql i386 5.0.77-4.el5_5.3 ruby-irb i686 1.8.6.111-1 ruby-mysql i686 2.7.4-1 ruby-rdoc i686 1.8.6.111-1 rubygem-rake noarch 0.8.7-2.el5 rubygems noarch 1.3.1-1.el5 Install 7 Package(s) Upgrade 0 Package(s) Total download size: 11 M Is this ok [y/N]: y [...]
Create a MySQL database for puppet-dashboard
Create a database for puppet-dashboard to use and set up a user with all privileges to use it. This can be done on a seperate host.
mysql> CREATE DATABASE puppetdash; Query OK, 1 row affected (0.00 sec) mysql> GRANT ALL PRIVILEGES ON puppetdash.* TO puppet@'%' IDENTIFIED BY 'punchandjudy'; Query OK, 0 rows affected (0.00 sec)
Configure database.yaml
cd /usr/share/puppet-dashboard vi config/database.yaml
Add your database parameters to the development section, note that host: can be ommitted if you are using local sockets to connect to MySQL.
development: host: professor.craigdunn.org database: puppetdash username: puppet password: punchandjudy encoding: utf8 adapter: mysql
Migrate the database
punch# rake RAILS_ENV=development db:migrate
[...]
(in /usr/share/puppet-dashboard)
== BasicSchema: migrating ====================================================
-- create_table(:assignments, {:force=>true})
-> 0.0072s
-- create_table(:nodes, {:force=>true})
-> 0.0030s
-- create_table(:services, {:force=>true})
-> 0.0026s
== BasicSchema: migrated (0.0132s) ===========================================
[...]Copy reports module to site_ruby
I hate doing this but puppetmasterd explicitly looks for reports in puppet/reports and so far I haven’t found a clean workaround to tell it to look in /usr/share/puppet-dashboard for it. If anyone knows of a way, please email me.
punch# cp /usr/share/puppet-dashboard/ext/puppet/puppet_dashboard.rb /usr/lib/ruby/site_ruby/1.8/puppet/reports
Edit your puppet.conf
Include the following in the [master] section, changing punch.craigdunn.org to your puppet server
[master] reports = puppet_dashboard,store reportdir = /var/lib/puppet/reports reporturl = http://punch.craigdunn.org:3000/reports
Restart puppetmaster and start puppet-dashboard
punch# service puppetmaster restart Stopping puppetmaster: [ OK ] Starting puppetmaster: [ OK ] punch# service puppet-dashboard start Starting puppet-dashboard: [ OK ]
Test web GUI
Go to the following link in your browser (replacing the hostname with your fqdn)
http://punch.craigdunn.org:3000/
Configure the client
Edit puppet.conf
Make sure the following things are set in the [agent] section of puppet.conf on your client node.
judy# vi /etc/puppet/puppet.conf
[agent]
report = true
Run puppet in noop mode on the client
judy# puppetd --noop --test
Refresh browser
If all has gone well, you should now see your reports in puppet dashboard for your client node.
[...] Next: Installing Puppet Dashboard [...]
Hi Craig,
nice tutorial ! That’s clearly the best one on Internet actually.
to avoid copying puppet_dashboard.rb in ruby directory (which I agree is not clean) you can do the following :
[master]
# indicate where to send reports
reports = http,store,log
# give the url of the web reports manager
reporturl = http://localhost:3000/reports
# Where to find information about nodes
node_terminus = exec
# An external command that can produce node information
external_nodes = /usr/share/puppet-dashboard/bin/external_node
That’s cleaner and http value is included in reports option.
Cheers, kaverne.
Thanks for that (and apologies for the delay, I’m getting a lot of spam comments on these articles!)
Craig
thanks, great tutorial. got me up and running in no time.
nice article.
i am getting the following error while starting puppet-dashboard.
Starting Puppet Dashboard: => Booting WEBrick
=> Rails 2.3.5 application starting on http://0.0.0.0:3000
Database isn’t the current migration version: expected 20100916183948, got 0
You must either run ‘rake db:migrate’ or set environmental variable NO_MIGRATION_CHECK
[FAILED]
I found solution by myself.
Upgraded the puppet to 2.6.6 and did another db migrate and it succeeded.
The Foreman is a better Dashboard:
http://theforeman.org/projects/foreman/wiki/Features