Skip to content

Commit

Permalink
Merge pull request #2 from mattthias/graph_strategy_configurable
Browse files Browse the repository at this point in the history
Graph strategy configurable
  • Loading branch information
ssm committed Jul 28, 2013
2 parents b09963b + 1bf15d3 commit b7779da
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
14 changes: 13 additions & 1 deletion manifests/master.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,19 @@
# - node_definitions: A hash of node definitions used by
# create_resources to make static node definitions.
#
class munin::master ($node_definitions={}) {
# - graph_strategy: 'cgi' (default) or 'cron'
# Controls if munin-graph graphs all services ('cron') or if graphing is done
# by munin-cgi-graph (which must configured seperatly)
#
# - html_strategy: 'cgi' (default) or 'cron'
# Controls if munin-html will recreate all html pages every run interval
# ('cron') or if html pages are generated by munin-cgi-graph (which must
# configured seperatly)
class munin::master (
$node_definitions={},
$graph_strategy = 'cgi',
$html_strategy = 'cgi',
) {

# The munin package and configuration
package { 'munin':
Expand Down
14 changes: 14 additions & 0 deletions spec/classes/munin_master_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,18 @@
it {
should contain_package('munin')
}

it do
should contain_file('/etc/munin/munin.conf')\
.with_content(/^graph_strategy cgi$/)
end

context 'with graph_strategy => cron' do
let(:params) { {:graph_strategy => 'cron'} }

it do
should contain_file('/etc/munin/munin.conf')\
.with_content(/^graph_strategy cron$/)
end
end
end
4 changes: 2 additions & 2 deletions templates/munin.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# This file is handled by puppet, all local modifications will be lost

# Generate web pages on demand
html_strategy cgi
graph_strategy cgi
html_strategy <%= @html_strategy %>
graph_strategy <%= @graph_strategy %>

# Where to look for puppet generated munin master configuration.
includedir /etc/munin/munin-conf.d

0 comments on commit b7779da

Please sign in to comment.