summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
Diffstat (limited to 'manifests')
-rw-r--r--manifests/client/gentoo.pp1
-rw-r--r--manifests/client/openbsd.pp1
-rw-r--r--manifests/client/package.pp1
-rw-r--r--manifests/host.pp2
-rw-r--r--manifests/host/cgi.pp25
-rw-r--r--manifests/plugin.pp1
-rw-r--r--manifests/plugins/centos.pp3
-rw-r--r--manifests/plugins/setup.pp4
8 files changed, 35 insertions, 3 deletions
diff --git a/manifests/client/gentoo.pp b/manifests/client/gentoo.pp
index 6a01050..e79f6b0 100644
--- a/manifests/client/gentoo.pp
+++ b/manifests/client/gentoo.pp
@@ -1,4 +1,5 @@
class munin::client::gentoo inherits munin::client::package {
+
Package['munin-node'] {
name => 'munin',
category => 'net-analyzer',
diff --git a/manifests/client/openbsd.pp b/manifests/client/openbsd.pp
index 1852962..cd21abf 100644
--- a/manifests/client/openbsd.pp
+++ b/manifests/client/openbsd.pp
@@ -1,5 +1,6 @@
# currently we install munin on openbsd by targz
# :(
+
class munin::client::openbsd inherits munin::client::base {
if $::operatingsystemrelease == '4.3' {
file{'/usr/src/munin_openbsd.tar.gz':
diff --git a/manifests/client/package.pp b/manifests/client/package.pp
index 58f40da..206ccc8 100644
--- a/manifests/client/package.pp
+++ b/manifests/client/package.pp
@@ -9,3 +9,4 @@ class munin::client::package inherits munin::client::base {
before => Package['munin-node'],
}
}
+
diff --git a/manifests/host.pp b/manifests/host.pp
index 0992d2b..007c43a 100644
--- a/manifests/host.pp
+++ b/manifests/host.pp
@@ -4,7 +4,7 @@
class munin::host(
$cgi_graphing = false,
- $cgi_owner = 'apache',
+ $cgi_owner = 'os_default',
$export_tag = 'munin'
) {
package {"munin": ensure => installed, }
diff --git a/manifests/host/cgi.pp b/manifests/host/cgi.pp
index 6e5efcd..1c0072d 100644
--- a/manifests/host/cgi.pp
+++ b/manifests/host/cgi.pp
@@ -1,8 +1,29 @@
class munin::host::cgi(
- $owner = 'apache'
+ $owner = 'os_default'
) {
+ case $::operatingsystem {
+ debian,ubuntu: {
+ $document_root = '/var/www/munin'
+ }
+ default: {
+ $document_root = '/var/www/html/munin'
+ }
+ }
+ if $owner == 'os_default' {
+ case $::operatingsystem {
+ debian,ubuntu: {
+ $apache_user = 'www-data'
+ }
+ default: {
+ $apache_user = 'apache'
+ }
+ }
+ } else {
+ $apache_user = $owner
+ }
+
exec{'set_modes_for_cgi':
- command => "chgrp ${owner} /var/log/munin /var/log/munin/munin-graph.log && chmod g+w /var/log/munin /var/log/munin/munin-graph.log && find /var/www/html/munin/* -maxdepth 1 -type d -exec chgrp -R ${owner} {} \; && find /var/www/html/munin/* -maxdepth 1 -type d -exec chmod -R g+w {} \;",
+ command => "chgrp ${apache_user} /var/log/munin /var/log/munin/munin-graph.log && chmod g+w /var/log/munin /var/log/munin/munin-graph.log && find ${document_root}/* -maxdepth 1 -type d -exec chgrp -R ${apache_user} {} \; && find ${document_root}/* -maxdepth 1 -type d -exec chmod -R g+w {} \;",
refreshonly => true,
subscribe => Concat::Fragment['munin.conf.header'],
}
diff --git a/manifests/plugin.pp b/manifests/plugin.pp
index 36fc81b..ffe5452 100644
--- a/manifests/plugin.pp
+++ b/manifests/plugin.pp
@@ -54,3 +54,4 @@ define munin::plugin (
}
}
}
+
diff --git a/manifests/plugins/centos.pp b/manifests/plugins/centos.pp
new file mode 100644
index 0000000..60c706c
--- /dev/null
+++ b/manifests/plugins/centos.pp
@@ -0,0 +1,3 @@
+class munin::plugins::centos inherits munin::plugins::base {
+ munin::plugin { users: ensure => present; }
+}
diff --git a/manifests/plugins/setup.pp b/manifests/plugins/setup.pp
index 5c56099..197b657 100644
--- a/manifests/plugins/setup.pp
+++ b/manifests/plugins/setup.pp
@@ -1,4 +1,8 @@
class munin::plugins::setup {
+
+ # This is required for the munin-node service and package requirements below.
+ include munin::client
+
file {
[ '/etc/munin/plugins', '/etc/munin/plugin-conf.d' ]:
ignore => 'snmp_*',