Install puppet-dashboard on RedHat/CentOS 5

If you have a puppet network in place you will want to use puppet-dashboard. It is a fairly new project and still has some misssing pieces but overall a good way to tell the health of your puppet network. The thing I really like about it is that you can see when the last check in time is for a client and if it had any errors or warnings during its runs so you can fix them.

The big issue is that out of the box its a bit hard to get running on Redhat/CentOS. No worries I spent some time to make it work and passing it on to you.

Install Rake

rpm -ivh http://mirrors.tummy.com/pub/fedora.redhat.com/epel/5/x86_64/rubygems-1.3.1-1.el5.noarch.rpm
rpm -ivh http://mirrors.tummy.com/pub/fedora.redhat.com/epel/5/x86_64/rubygem-rake-0.8.3-1.el5.noarch.rpm

Install MySQL bindings for Ruby

rpm -ivh http://mirrors.tummy.com/pub/fedora.redhat.com/epel/5/x86_64/ruby-mysql-2.7.3-1.el5.x86_64.rpm

Install git if needed

yum install git

I like to install non-rpmed apps in /opt so that is where I will clone the git project

cd /opt
git clone git://github.com/reductivelabs/puppet-dashboard.git

Now lets config the database. As of writing this, there is an error in the sample configs but one of the authors told me he was doing to fix them. It is in user and pass, they should be username and password

So here is my sample config

cd puppet-dashboard
cat config/database.yml

Here are the contents




development:
    adapter: mysql
    database: puppet_dash
    username: puppet
    password: master
    encoding: utf8
    host: 192.168.100.5 
Now create the database
rake install
Now lets config our puppet clients to make sure they send reports back to the servers. So edit the following file on the clients
/etc/puppet/puppet.conf
In the [puppetd] section add the following
report = true
Then on the puppetmaster server edit the following file
/etc/sysconfig/puppetmaster
Find the following line
#PUPPETMASTER_EXTRA_OPTS=–noca
Change it to
PUPPETMASTER_EXTRA_OPTS=”––reports puppet_dashboard”
Now move the puppet_dashboard file. This should be the same for 64bit and 32bit. I am using 64bit and it works
cp /opt/puppet-dashboard/puppet/lib/puppet_dashboard.rb /usr/lib/ruby/site_ruby/1.8/puppet/reports/
Now restart puppetmaster
service puppetmaster restart
Now run puppet-dashboard
/opt/puppet-dashboard/script/server

I also wrote a post on setting up a init.d script for puppet-dashboard

About mike
Currently works for OpenSky as a Senior Linux Admin. He has a wonderful wife Thanuja and 2 great dogs. His major side project is Photoblog.

Comments

27 Responses to “Install puppet-dashboard on RedHat/CentOS 5”
  1. Thanks for the writeup, Mike.

    Installing dashboard on systems that run Ruby 1.8.5 is a bit trickier than usual (you have to install the mysql bindings using a system package, for instance) but hopefully not unnecessarily so.

    Also, the sample database.yml that is copied during rake:install has been fixed. Thanks for bringing it to our attention.

    • mike says:

      thanks for all the hard work on the dashboard. I love all the error reporting I get to see to see the health of my puppet network. I can’t wait for updates.

  2. Mick Pollard says:

    Thanks for the post. It helped me to get the dashboard up for reporting only which is what I wanted.
    ————————————————————
    In the [puppet] section add the following
    report = true
    ————————————————————

    I had to do this under [puppetd] and not [puppet] for it to work.
    I guess this would depend if you run puppet from cron or as a daemon ?

  3. Eli Klein says:

    So I’m running into a cryptic error when attempting the rake install.. I can connect to the DB with the username/password combination I used in config/database.yml. In addition, all my version numbers match what you’re specifying above. I’m running this on centos 5.4.

    Here’s a full trace:

    (in /usr/local/puppet-dashboard)
    ** Invoke install (first_time)
    ** Invoke copy_config (first_time)
    ** Invoke config/database.yml (first_time, not_needed)
    ** Invoke config/database.yml.example (first_time, not_needed)
    ** Execute copy_config
    ** Invoke db:create (first_time)
    ** Invoke db:load_config (first_time)
    ** Invoke rails_env (first_time)
    ** Execute rails_env
    ** Execute db:load_config
    ** Execute db:create
    rake aborted!
    undefined method `[]‘ for nil:NilClass
    /usr/local/puppet-dashboard/vendor/rails/railties/lib/tasks/databases.rake:55:in `create_database’
    /usr/local/puppet-dashboard/vendor/rails/railties/lib/tasks/databases.rake:31
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:616:in `call’
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:616:in `execute’
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:611:in `each’
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:611:in `execute’
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:577:in `invoke_with_call_chain’
    /usr/lib/ruby/1.8/monitor.rb:238:in `synchronize’
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:570:in `invoke_with_call_chain’
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:587:in `invoke_prerequisites’
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:584:in `each’
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:584:in `invoke_prerequisites’
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:576:in `invoke_with_call_chain’
    /usr/lib/ruby/1.8/monitor.rb:238:in `synchronize’
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:570:in `invoke_with_call_chain’
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:563:in `invoke’
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2018:in `invoke_task’
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1996:in `top_level’
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1996:in `each’
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1996:in `top_level’
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2035:in `standard_exception_handling’
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1990:in `top_level’
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1969:in `run’
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2035:in `standard_exception_handling’
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1966:in `run’
    /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/bin/rake:31
    /usr/bin/rake:19:in `load’
    /usr/bin/rake:19

    Any idea what’s going on here?

    Thanks in advance for any help!

    • mike says:

      I did look at foreman and i like it. I went with dashboard since all I really wanted to see was if nodes were erroring out during check in.

      Plus I like a challenge and there was no instructions for setting it up with a very common distro like Redhat/CentOS 5

      • Ohad says:

        Just to clarify based on your comment – Foreman fully supports telling you what is the states of your nodes as part of its own dashboard.

        Foreman has a mode which disable the OS provisioning, acting as a puppet external nodes, inventory and reporting infrastructure

  4. melanie says:

    Hello

    Can I use Oracle instead of mysql or sqlite ?
    thx.

  5. Not sure if it’s a typo in your instructions or they re-structured the puppet-dashboard package a little bit but the puppet_dashboard.rb file now resides in puppet-dashboard/lib/puppet

  6. mahmoud says:

    Thanks for this really helpful,but the dashboard does not show all my classes and node it is showing only the samples, how do i get all my classes and nodes to show it the dashboard

    • Jean-Yves Le Roux says:

      This post is very helpful but, as mahmoud have, dashboard don’t show me “production” view; and rake install only create “development” database. Is there a parameter to fix “production” environment?

      Thank’s for you help.

      • Jean-Yves Le Roux says:

        I Can import puppet reports to dashboard :
        rake reports:import
        Importing 157410 reports from /var/lib/puppet/reports/
        but ……

        • Steven Seed says:

          I have the same issue. How do you get it to pick up the reports automatically from the production environment without importing them?

  7. Mike –

    Thanks, the install went great using the steps above.

    One other thing to add is if you have two puppet masters that you’d like to report to one dashboard, you just need to:

    - copy over ‘puppet_dashboard.rb’ with a modified HOST line
    - modify /etc/sysconfig/puppetmaster
    - turn on reporting on the clients
    - restart puppetmaster

    Andrew

  8. 2hei says:

    hi, i have install puppet and puppet_dashboard in my virtualBox.

    In puppet dashboard i add a node (just my client puppet).

    I meet a issue:
    Unreported Nodes
    1 node has not yet reported: test03.testdev.com.

    this is my config:

    puppet client:
    [puppetd]
    report = true

    puppet server:
    [puppetmasterd]
    reports = puppet_dashboard

    /usr/lib/ruby/site_ruby/1.8/puppet/reports/puppet_dashboard.rb

    service puppetmaster restart
    Now run puppet-dashboard
    /opt/puppet-dashboard/script/server
    /usr/sbin/puppetmasterd
    PUPPETMASTER_EXTRA_OPTS=”–reports puppet_dashboard”

    I dont’t known why doesn’t report?
    thx

Trackbacks

Check out what others are saying about this post...
  1. [...] if anyone knew of a init.d script for redhat/fedora for puppet-dashboard. I have a blog post about installing puppet-dashboard on Redhat/CentOS and I don’t think there is any init.d script out there. So time to write [...]

  2. [...] Install puppet-dashboard on RedHat/CentOS 5 : Mike Zupan’s Random Blog – May 24th %(postalicious-tags)( tags: puppet sysadmin centos linux reporting howto rhel todo install puppet-dashboard )% [...]

  3. [...] Mike Zupan’s blog has a nice how to on installing puppet’s dashboard on CentOS 5, following it I was able to get the dashboard up and running with ease.  Since I have two puppet master’s that I’d like to report to the dashboard I found you can easily accomplish this without a full dashboard install on each master. [...]

  4. [...] 2.http://zcentric.com/2010/03/11/install-puppet-dashboard-on-redhatcentos-5/ 分类: puppet, 运维 标签: dashboard, puppet 评论 (0) Trackbacks (0) 发表评论 Trackback [...]

  5. Akane soma. says:

    Soma next day delievery….

    Soma overnight. Soma medication….



Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!