summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2013-11-03 17:46:46 +0100
committermh <mh@immerda.ch>2013-11-03 17:46:46 +0100
commitd2a2cb77b9a9ca5deddecdec3d14ac763388929e (patch)
tree6ba8bbb61a49ce75681d1ec9135dea74221b5c7e /manifests
parent6856c8bb3f11073a47ab705d0e2012a0c90acae3 (diff)
cleanup openbsd manual installation + remove unnecessary files
The manual OpenBSD installation is now so old and not needed anymore.
Diffstat (limited to 'manifests')
-rw-r--r--manifests/client.pp2
-rw-r--r--manifests/client/base.pp15
-rw-r--r--manifests/client/centos.pp4
-rw-r--r--manifests/client/debian.pp13
-rw-r--r--manifests/client/gentoo.pp2
-rw-r--r--manifests/client/openbsd.pp40
-rw-r--r--manifests/client/package.pp13
-rw-r--r--manifests/plugins/centos.pp6
8 files changed, 26 insertions, 69 deletions
diff --git a/manifests/client.pp b/manifests/client.pp
index f91436f..b7cd5d4 100644
--- a/manifests/client.pp
+++ b/manifests/client.pp
@@ -36,7 +36,7 @@ class munin::client(
}
}
centos: {
- class { 'munin::client::package':
+ class { 'munin::client::base':
before => Anchor['munin::client::installed']
}
}
diff --git a/manifests/client/base.pp b/manifests/client/base.pp
index 3c0ba89..e81028d 100644
--- a/manifests/client/base.pp
+++ b/manifests/client/base.pp
@@ -1,10 +1,14 @@
# Install a basic munin client
class munin::client::base {
+ package { 'munin-node':
+ ensure => installed
+ }
service { 'munin-node':
- ensure => running,
- enable => true,
- hasstatus => true,
- hasrestart => true,
+ ensure => running,
+ enable => true,
+ hasstatus => true,
+ hasrestart => true,
+ require => Package[munin-node],
}
file {'/etc/munin':
ensure => directory,
@@ -14,6 +18,9 @@ class munin::client::base {
}
file {'/etc/munin/munin-node.conf':
content => template("munin/munin-node.conf.${::operatingsystem}"),
+ # this has to be installed before the package, so the postinst can
+ # boot the munin-node without failure!
+ before => Package['munin-node'],
notify => Service['munin-node'],
mode => '0644',
owner => root,
diff --git a/manifests/client/centos.pp b/manifests/client/centos.pp
deleted file mode 100644
index cd4f2f6..0000000
--- a/manifests/client/centos.pp
+++ /dev/null
@@ -1,4 +0,0 @@
-# Install a munin client on centos
-class munin::client::centos inherits munin::client::package {
- include munin::plugins::centos
-}
diff --git a/manifests/client/debian.pp b/manifests/client/debian.pp
index 3cfc3fc..f94356a 100644
--- a/manifests/client/debian.pp
+++ b/manifests/client/debian.pp
@@ -1,11 +1,18 @@
# Install the munin client on debian
-class munin::client::debian inherits munin::client::package {
+class munin::client::debian inherits munin::client::base {
# the plugin will need that
- package { 'iproute': ensure => installed }
+ package { 'iproute':
+ ensure => installed
+ }
+
+ $hasstatus = $::lsbdistcodename ? {
+ sarge => false,
+ default => true
+ }
Service['munin-node']{
# sarge's munin-node init script has no status
- hasstatus => $::lsbdistcodename ? { sarge => false, default => true }
+ hasstatus => $hasstatus
}
File['/etc/munin/munin-node.conf']{
content => template("munin/munin-node.conf.${::operatingsystem}.${::lsbdistcodename}"),
diff --git a/manifests/client/gentoo.pp b/manifests/client/gentoo.pp
index 186950b..fde592f 100644
--- a/manifests/client/gentoo.pp
+++ b/manifests/client/gentoo.pp
@@ -1,5 +1,5 @@
# install a munin client on gentoo
-class munin::client::gentoo inherits munin::client::package {
+class munin::client::gentoo inherits munin::client::base {
Package['munin-node'] {
name => 'munin',
diff --git a/manifests/client/openbsd.pp b/manifests/client/openbsd.pp
index e3c18d5..5ced4c4 100644
--- a/manifests/client/openbsd.pp
+++ b/manifests/client/openbsd.pp
@@ -1,53 +1,19 @@
-# currently we install munin on openbsd by targz
-# :(
-
+# generate a few missing things on openbsd
class munin::client::openbsd inherits munin::client::base {
- if $::operatingsystemrelease == '4.3' {
- file{'/usr/src/munin_openbsd.tar.gz':
- source => 'puppet:///modules/munin/openbsd/package/munin_openbsd.tar.gz',
- owner => root,
- group => 0,
- mode => '0600';
- }
- exec{'extract_openbsd':
- command => 'cd /;tar xzf /usr/src/munin_openbsd.tar.gz',
- unless => 'test -d /opt/munin',
- require => File['/usr/src/munin_openbsd.tar.gz'],
- before => File['/var/run/munin'],
- }
- package{'p5-Compress-Zlib':
- ensure => installed,
- before => File['/var/run/munin'],
- }
- } else {
- package{'munin-node':
- ensure => installed,
- }
- }
- package{ [ 'p5-Crypt-SSLeay', 'p5-HTML-Parser', 'p5-HTML-Tagset', 'p5-HTTP-GHTTP',
- 'p5-LWP-UserAgent-Determined', 'p5-Net-SSLeay', 'p5-Net-Server',
- 'p5-URI', 'p5-libwww', 'pcre', 'curl' ]:
- ensure => installed,
- before => File['/var/run/munin'],
- }
file{[ '/var/run/munin', '/var/log/munin' ]:
ensure => directory,
owner => root,
group => 0,
mode => '0755';
}
- $bin_loc = $::operatingsystemrelease ? {
- '4.3' => '/opt/munin/sbin/munin-node',
- default => '/usr/local/sbin/munin-node'
- }
openbsd::rc_local{'munin-node':
- binary => $bin_loc,
+ binary => '/usr/local/sbin/munin-node',
require => File['/var/run/munin'],
}
Service['munin-node']{
restart => '/bin/kill -HUP `/bin/cat /var/run/munin/munin-node.pid`',
stop => '/bin/kill `/bin/cat /var/run/munin/munin-node.pid`',
- start => $bin_loc,
+ start => '/usr/local/sbin/munin-node',
status => 'test -e /var/run/munin/munin-node.pid && (ps ax | egrep -q "^ *$(cat /var/run/munin/munin-node.pid).*munin-node")',
hasstatus => true,
hasrestart => true,
diff --git a/manifests/client/package.pp b/manifests/client/package.pp
deleted file mode 100644
index 0958202..0000000
--- a/manifests/client/package.pp
+++ /dev/null
@@ -1,13 +0,0 @@
-# Install a munin client using packages
-class munin::client::package inherits munin::client::base {
- package { 'munin-node': ensure => installed }
- Service['munin-node']{
- require => Package[munin-node],
- }
- File['/etc/munin/munin-node.conf']{
- # 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/plugins/centos.pp b/manifests/plugins/centos.pp
deleted file mode 100644
index 0bb7697..0000000
--- a/manifests/plugins/centos.pp
+++ /dev/null
@@ -1,6 +0,0 @@
-# Install munin plugins for centos
-class munin::plugins::centos inherits munin::plugins::base {
- munin::plugin { 'users':
- ensure => present,
- }
-}