DevOps Monkey Goodness

Configure Puppet Open Source Dashboard – How To Series Part 2

In part 1 of this how to series we installed a very basic master and agent setup, at this point there is no interface or database and we are using the built in web server for testing purposes.

in part two we’ll install and configure the Puupet Dashboard.

You can find the official Puppet guide to installing the dashboard here: http://docs.puppetlabs.com/dashboard/manual/1.2/bootstrapping.html#installing-dependencies

 

You should read the official guide to get comfortable with the terms and process.  in this guide I will go through how I installed it and anything additional that I came across.

Part 1 – How to install puppet open source on virtual box 

Part 2 – How To install and Configure Puppet Dashboard

Part 3 – How to install and configure Puppet open source on Windows 

Step 1 – Install Puppet Dashboard

When installing from packages, Dashboard will be installed in /usr/share/puppet-dashboard, and the puppet-dashboard user and group will own the files; this user will be automatically created if it doesn’t exist.

  1. To start lets drop down into root:
    # su –
  2. Install the Puppet Dashboard (with dependencies)
    # yum install -y 
    # yum install -y mysql-server 
    # yum install -y puppet-dashboard

Step 2 – Configure Puppet Dashboard

  1. # nano /usr/share/puppet-dashboard/settings.yml
  2. Update the following:
      ca_server: puppet.local inventory_server: puppet.local file_bucket_server: puppet.local enable_inventory_service: true

Step 3 – Install and Configure MySQL

  1. We’ll configure the Dashboard to use MySQL, ensure MySQL is set to auto start:
    # service mysqld start
    # chkconfig mysqld on
  2. Set the MySql root password (don’t forget it!)
    # /usr/bin/mysqladmin -u root password “password”
  3. Dropdown into the MySQL admin command prompt (enter the password set above when prompted):
    mysql -u root -p 
  4. Create the database:
    CREATE DATABASE dashboard CHARACTER SET utf8; CREATE USER ‘dashboard’@’localhost’ IDENTIFIED BY ‘password’; GRANT ALL PRIVILEGES ON dashboard.* TO ‘dashboard’@’localhost’; exit
  5. Edit my.cnf
    # nano /etc/my.cnf 
  6. Add the following key in the [mysqld] section:
    max_allowed_packet=32M  
  7. Restart MySQL
    # service mysqld restart 
  8. Edit the dashboard database settings:
    # nano /usr/share/puppet-dashboard/config/database.yml 
  9. Update the database settings in the “production” section:
    database: database
    password: password 
  10. Prepare the schemas:
    # cd /usr/share/puppet-dashboard
    # rake gems:refresh_specs
    # rake RAILS_ENV=production db:migrate 
  11. Set permissions on the dashboard folders:
    # chmod 0666 /usr/share/puppet-dashboard/log/production.log
    # service puppet-dashboard-workers start
    # chkconfig puppet-dashboard-workers on 

Step 4  – Test The Dashboard is Working

Before we go any further lets do a quick check to ensure the dashboard is working.

  1. Run the following:
    # sudo -u puppet-dashboard ./script/server -e production
 

Step 5 – Configure Puppet Reporting and External node Classifier

  1. Leave the WEBrick terminal session and running the dashboard and open another terminal as root.
  2. Edit puppet.conf:
    # nano /etc/puppet/puppet.conf 
  3. Add the following “master” section:
    [master]
     reports = store, http
     reporturl = http://localhost:3000/reports/upload
     node_terminus = exec
     external_nodes = /usr/bin/env PUPPET_DASHBOARD_URL=http://localhost:3000 /usr/share/puppet-dashboard/bin/external_node
    (NOTE: there is space after 3000)
  4. Restart puppet master:
  5. # service puppetmaster restart

    Test Puppet Reporting

  6. Run another agent test:
    # puppet agent –test 

After running the last test you should see something like the following, if you get any not found errors after running puppet agent –test then go back and review the exteral_nodes value in puppet.conf as described above.

No Comments Yet

Leave a Reply