Puppet Reports » History » Version 18

Version 17 (khomkrit viangvises, 04/12/2011 06:33 AM) → Version 18/25 (khomkrit viangvises, 04/12/2011 06:35 AM)

h1. Puppet Reports integration

*Note* You need Foreman 0.1-1 or newer to support Puppet Reports and the puppet version installed on your foreman host should match the version on your master.

h2. Overview

Foreman uses a custom puppet reports (similar to tagmail or store) which simply upload the puppet report to Foreman.
This enables you to see the reports through the web interface as soon as the client finish its run.

h2. Configuration

h3. client

Ensure that the puppet clients has the following option in their puppet.conf:
report = true

Without it, no reports will be sent.

h3. puppetmaster

# copy *extras/puppet/foreman/files/foreman-report.rb* to your report directory
# e.g. /usr/lib/ruby/1.8/puppet/reports/foreman.rb or /var/lib/gems/1.8/gems/puppet-2.6.4/lib/puppet/reports/foreman.rb
# make sure you copied the foreman-report.rb to *foreman.rb* so puppet can find it!
# open the new file with your favorite editor
# edit the URL (unless you have a DNS alias for foreman already) to point to foreman.
# add this report in your puppetmaster reports - e.g, in your master puppet.conf under the main section add:

<pre>reports=log, foreman</pre>

and restart your puppetmaster

You should start seeing reports coming in under the reports link.

h2. Expire Reports automatically

You would probably want to delete your reports after some time, in order to do so, you would need to set a cronjob:

Available conditions:
* days => number of days to keep reports (defaults to 7)
* status => status of the report (defaults to 0 --> "reports with no errors")

# Expires all reports regardless of their status
rake reports:expire days=7 RAILS_ENV="production" RAILS_ENV="production
# expires all non interesting reports after one day
rake reports:expire days=1 status=0 RAILS_ENV="production