From 9fd1de5acd9064a0d67ca9d2c13a829a3f628f39 Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 5 Jun 2012 19:39:49 -0300 Subject: new style for 2.7 --- manifests/client/base.pp | 38 ++++++++--------- manifests/client/centos.pp | 2 +- manifests/client/debian.pp | 24 +++++------ manifests/client/gentoo.pp | 2 +- manifests/client/openbsd.pp | 102 ++++++++++++++++++++++---------------------- manifests/client/package.pp | 18 ++++---- 6 files changed, 93 insertions(+), 93 deletions(-) (limited to 'manifests/client') diff --git a/manifests/client/base.pp b/manifests/client/base.pp index 0c7a62a..80a25c5 100644 --- a/manifests/client/base.pp +++ b/manifests/client/base.pp @@ -1,23 +1,23 @@ class munin::client::base( $munin_allow = hiera('munin_allow','127.0.0.1') ) { - service { 'munin-node': - ensure => running, - enable => true, - hasstatus => true, - hasrestart => true, - } - file {'/etc/munin': - ensure => directory, - mode => 0755, owner => root, group => 0; - } - file {'/etc/munin/munin-node.conf': - content => template("munin/munin-node.conf.${::operatingsystem}"), - notify => Service['munin-node'], - mode => 0644, owner => root, group => 0, - } - munin::register { $::fqdn: - config => [ 'use_node_name yes', 'load.load.warning 5', 'load.load.critical 10'], - } - include munin::plugins::base + service { 'munin-node': + ensure => running, + enable => true, + hasstatus => true, + hasrestart => true, + } + file {'/etc/munin': + ensure => directory, + mode => 0755, owner => root, group => 0; + } + file {'/etc/munin/munin-node.conf': + content => template("munin/munin-node.conf.${::operatingsystem}"), + notify => Service['munin-node'], + mode => 0644, owner => root, group => 0, + } + munin::register { $::fqdn: + config => [ 'use_node_name yes', 'load.load.warning 5', 'load.load.critical 10'], + } + include munin::plugins::base } diff --git a/manifests/client/centos.pp b/manifests/client/centos.pp index 42e8c59..3a7151b 100644 --- a/manifests/client/centos.pp +++ b/manifests/client/centos.pp @@ -1,3 +1,3 @@ class munin::client::centos inherits munin::client::package { - include munin::plugins::centos + include munin::plugins::centos } diff --git a/manifests/client/debian.pp b/manifests/client/debian.pp index 903fb2d..e67ac26 100644 --- a/manifests/client/debian.pp +++ b/manifests/client/debian.pp @@ -1,15 +1,15 @@ class munin::client::debian inherits munin::client::package { - # the plugin will need that - package { "iproute": ensure => installed } + # the plugin will need that + package { "iproute": ensure => installed } - Service["munin-node"]{ - # sarge's munin-node init script has no status - hasstatus => $::lsbdistcodename ? { sarge => false, default => true } - } - 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 + Service["munin-node"]{ + # sarge's munin-node init script has no status + hasstatus => $::lsbdistcodename ? { sarge => false, default => true } + } + 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/gentoo.pp b/manifests/client/gentoo.pp index c24d317..6a01050 100644 --- a/manifests/client/gentoo.pp +++ b/manifests/client/gentoo.pp @@ -4,5 +4,5 @@ class munin::client::gentoo inherits munin::client::package { category => 'net-analyzer', } - include munin::plugins::gentoo + include munin::plugins::gentoo } diff --git a/manifests/client/openbsd.pp b/manifests/client/openbsd.pp index e1742d2..88d0640 100644 --- a/manifests/client/openbsd.pp +++ b/manifests/client/openbsd.pp @@ -1,59 +1,59 @@ # 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': - 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, - } + 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; } - 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'], + 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'], } - file{[ '/var/run/munin', '/var/log/munin' ]: - ensure => directory, - owner => root, group => 0, mode => 0755; + package{'p5-Compress-Zlib': + ensure => installed, + before => File['/var/run/munin'], } - openbsd::rc_local{'munin-node': - binary => $::operatingsystemrelease ? { - '4.3' => '/opt/munin/sbin/munin-node', - default => '/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 => $::operatingsystemrelease ? { - '4.3' => '/opt/munin/sbin/munin-node', - default => '/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, - require => [ File['/var/run/munin'], File['/var/log/munin'] ], - } - cron{'clean_munin_logfile': - command => 'rm /var/log/munin/munin-node.log; kill -HUP `cat /var/run/munin/munin-node.pid`', - minute => 0, - hour => 2, - weekday => 0, + } 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; + } + openbsd::rc_local{'munin-node': + binary => $::operatingsystemrelease ? { + '4.3' => '/opt/munin/sbin/munin-node', + default => '/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 => $::operatingsystemrelease ? { + '4.3' => '/opt/munin/sbin/munin-node', + default => '/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, + require => [ File['/var/run/munin'], File['/var/log/munin'] ], + } + cron{'clean_munin_logfile': + command => 'rm /var/log/munin/munin-node.log; kill -HUP `cat /var/run/munin/munin-node.pid`', + minute => 0, + hour => 2, + weekday => 0, + } } diff --git a/manifests/client/package.pp b/manifests/client/package.pp index 18566b8..58f40da 100644 --- a/manifests/client/package.pp +++ b/manifests/client/package.pp @@ -1,11 +1,11 @@ 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'], - } + 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'], + } } -- cgit v1.2.3