Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graph strategy configurable #2

Merged
merged 2 commits into from
Jul 28, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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