diff options
author | Ewoud Kohl van Wijngaarden <e.kohlvanwijngaarden@oxilion.nl> | 2013-07-02 22:49:02 +0200 |
---|---|---|
committer | Ewoud Kohl van Wijngaarden <e.kohlvanwijngaarden@oxilion.nl> | 2013-11-20 14:34:32 +0100 |
commit | 057658ba93e2562c596dfa5607836679631be916 (patch) | |
tree | 43d9398cbcd950553f59676a36740ffe316999ad /manifests | |
parent | 99782a1f6446e5fee1670e832f22731aef77d2f6 (diff) |
Unify OS specific munin-conf.conf
In essence all munin-node.conf files contained the same template,
besides a few values. By moving all to a single template, maintenance
burden is reduced. To ensure all values are still present in the
templates, tests are added.
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/client/base.pp | 4 | ||||
-rw-r--r-- | manifests/client/debian.pp | 3 | ||||
-rw-r--r-- | manifests/client/params.pp | 19 |
3 files changed, 21 insertions, 5 deletions
diff --git a/manifests/client/base.pp b/manifests/client/base.pp index e81028d..71531fa 100644 --- a/manifests/client/base.pp +++ b/manifests/client/base.pp @@ -1,5 +1,5 @@ # Install a basic munin client -class munin::client::base { +class munin::client::base inherits munin::client::params { package { 'munin-node': ensure => installed } @@ -17,7 +17,7 @@ class munin::client::base { group => 0, } file {'/etc/munin/munin-node.conf': - content => template("munin/munin-node.conf.${::operatingsystem}"), + content => template("${module_name}/munin-node.conf.erb"), # this has to be installed before the package, so the postinst can # boot the munin-node without failure! before => Package['munin-node'], diff --git a/manifests/client/debian.pp b/manifests/client/debian.pp index 63a0e14..f1bbb3c 100644 --- a/manifests/client/debian.pp +++ b/manifests/client/debian.pp @@ -12,9 +12,6 @@ class munin::client::debian inherits munin::client::base { # sarge's munin-node init script has no status hasstatus => $hasstatus } - File['/etc/munin/munin-node.conf']{ - content => template("munin/munin-node.conf.${::operatingsystem}.${::lsbdistcodename}"), - } # workaround bug in munin_node_configure plugin { 'postfix_mailvolume': ensure => absent } include munin::plugins::debian diff --git a/manifests/client/params.pp b/manifests/client/params.pp new file mode 100644 index 0000000..14d3749 --- /dev/null +++ b/manifests/client/params.pp @@ -0,0 +1,19 @@ +# Set the parameters for the munin client +class munin::client::params { + $user = 'root' + + case $::operatingsystem { + 'OpenBSD': { + $group = '0' + $log_file = '/var/log/munin-node/munin-node.log' + } + 'Debian': { + $group = 'root' + $log_file = '/var/log/munin/munin-node.log' + } + default: { + $group = 'root' + $log_file = '/var/log/munin-node/munin-node.log' + } + } +} |