summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2011-05-07 17:25:17 +0200
committerintrigeri <intrigeri@boum.org>2011-05-07 17:25:17 +0200
commit86d85a63c11cf58ba3b3510b038dcafea9fc7573 (patch)
tree1013b1ef64087bab38182c5404bb3e072b54022d /manifests
parente922cee6daebfa27759f38d58ba5f89a42b149af (diff)
parente17c0e0fae335470971cc628d71a798d168e70af (diff)
Merge remote branch 'riseup/master'
Diffstat (limited to 'manifests')
-rw-r--r--manifests/client/base.pp1
-rw-r--r--manifests/client/darwin.pp1
-rw-r--r--manifests/client/debian.pp1
-rw-r--r--manifests/client/gentoo.pp1
-rw-r--r--manifests/client/openbsd.pp2
-rw-r--r--manifests/client/package.pp20
-rw-r--r--manifests/host.pp58
-rw-r--r--manifests/host/cgi.pp34
-rw-r--r--manifests/plugin.pp3
-rw-r--r--manifests/plugin/deploy.pp70
-rw-r--r--manifests/plugins/centos.pp3
11 files changed, 116 insertions, 78 deletions
diff --git a/manifests/client/base.pp b/manifests/client/base.pp
index 17387e8..7c2adc2 100644
--- a/manifests/client/base.pp
+++ b/manifests/client/base.pp
@@ -1,4 +1,5 @@
class munin::client::base {
+
service { 'munin-node':
ensure => running,
enable => true,
diff --git a/manifests/client/darwin.pp b/manifests/client/darwin.pp
index 369a605..9cfe7e9 100644
--- a/manifests/client/darwin.pp
+++ b/manifests/client/darwin.pp
@@ -1,4 +1,5 @@
class munin::client::darwin {
+
file { "/usr/share/snmp/snmpd.conf":
mode => 744,
content => template("munin/darwin_snmpd.conf.erb"),
diff --git a/manifests/client/debian.pp b/manifests/client/debian.pp
index 9cc16db..60b496d 100644
--- a/manifests/client/debian.pp
+++ b/manifests/client/debian.pp
@@ -1,4 +1,5 @@
class munin::client::debian inherits munin::client::package {
+
# the plugin will need that
if !defined(Package['iproute']) {
package { "iproute": ensure => installed }
diff --git a/manifests/client/gentoo.pp b/manifests/client/gentoo.pp
index c24d317..d4fe71e 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 7012c00..89b5752 100644
--- a/manifests/client/openbsd.pp
+++ b/manifests/client/openbsd.pp
@@ -1,6 +1,8 @@
# 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",
diff --git a/manifests/client/package.pp b/manifests/client/package.pp
index 18566b8..29f256d 100644
--- a/manifests/client/package.pp
+++ b/manifests/client/package.pp
@@ -1,11 +1,21 @@
class munin::client::package inherits munin::client::base {
- package { 'munin-node': ensure => installed }
+
+ if $munin_node_ensure_version == '' { $munin_node_ensure_version = 'installed' }
+
+ if $operatingsystem == "Debian" and $lsbdistcodename != "lenny" {
+ package { 'munin-common':
+ before => Package['munin-node'],
+ ensure => $munin_node_ensure_version;
+ }
+ }
+ package { 'munin-node': ensure => $munin_node_ensure_version }
Service['munin-node']{
- require => Package[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'],
+ # 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/host.pp b/manifests/host.pp
index e038fd7..9d30d6a 100644
--- a/manifests/host.pp
+++ b/manifests/host.pp
@@ -4,42 +4,46 @@
class munin::host inherits munin
{
- package {"munin": ensure => installed, }
- File <<| tag == 'munin' |>>
+ if $munin_ensure_version == '' { $munin_ensure_version = 'installed' }
- file{'/etc/munin/munin.conf.header':
- source => [ "puppet:///modules/site-munin/config/host/${fqdn}/munin.conf.header",
- "puppet:///modules/site-munin/config/host/munin.conf.header.$operatingsystem",
- "puppet:///modules/site-munin/config/host/munin.conf.header",
- "puppet:///modules/munin/config/host/munin.conf.header.$operatingsystem",
- "puppet:///modules/munin/config/host/munin.conf.header" ],
- notify => Exec['concat_/etc/munin/munin.conf'],
- owner => root, group => 0, mode => 0644;
- }
+ package {"munin": ensure => $munin_ensure_version, }
- concatenated_file { "/etc/munin/munin.conf":
- dir => '/var/lib/puppet/modules/munin/nodes',
- header => "/etc/munin/munin.conf.header",
- }
-
- file { ["/var/log/munin-update.log", "/var/log/munin-limits.log",
- "/var/log/munin-graph.log", "/var/log/munin-html.log"]:
- ensure => present,
- mode => 640, owner => munin, group => 0;
- }
-
- include munin::plugins::muninhost
-
- case $operatingsystem {
- centos: { include munin::host::cgi }
- }
+ File <<| tag == 'munin' |>>
+
+ file{'/etc/munin/munin.conf.header':
+ source => [ "puppet:///modules/site-munin/config/host/${fqdn}/munin.conf.header",
+ "puppet:///modules/site-munin/config/host/munin.conf.header.$operatingsystem",
+ "puppet:///modules/site-munin/config/host/munin.conf.header",
+ "puppet:///modules/munin/config/host/munin.conf.header.$operatingsystem",
+ "puppet:///modules/munin/config/host/munin.conf.header" ],
+ notify => Exec['concat_/etc/munin/munin.conf'],
+ owner => root, group => 0, mode => 0644;
+ }
+
+ concatenated_file { "/etc/munin/munin.conf":
+ dir => '/var/lib/puppet/modules/munin/nodes',
+ header => "/etc/munin/munin.conf.header",
+ }
+
+ file { ["/var/log/munin-update.log", "/var/log/munin-limits.log",
+ "/var/log/munin-graph.log", "/var/log/munin-html.log"]:
+ ensure => present,
+ mode => 640, owner => munin, group => 0;
+ }
+
+ include munin::plugins::muninhost
+
+ case $operatingsystem {
+ centos: { include munin::host::cgi }
+ }
# from time to time we cleanup hanging munin-runs
file{'/etc/cron.d/munin_kill':
content => "4,34 * * * * root if $(ps ax | grep -v grep | grep -q munin-run); then killall munin-run; fi\n",
owner => root, group => 0, mode => 0644;
}
+
if $use_shorewall {
include shorewall::rules::out::munin
}
diff --git a/manifests/host/cgi.pp b/manifests/host/cgi.pp
index 6fd50df..cbf1052 100644
--- a/manifests/host/cgi.pp
+++ b/manifests/host/cgi.pp
@@ -1,16 +1,28 @@
-class munin::host::cgi {
- exec{'set_modes_for_cgi':
- command => 'chgrp apache /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 apache {} \; && find /var/www/html/munin/* -maxdepth 1 -type d -exec chmod -R g+w {} \;',
+class munin::host::cgi inherits munin::host {
+
+ case $operatingsystem {
+ debian: {
+ exec { 'set_modes_for_cgi':
+ command => 'chgrp www-data /var/log/munin /var/log/munin/munin-graph.log && chmod g+w /var/log/munin /var/log/munin/munin-graph.log && find /var/www/munin/* -maxdepth 1 -type d -exec chgrp -R www-data {} \; && find /var/www/munin/* -maxdepth 1 -type d -exec chmod -R g+w {} \;',
refreshonly => true,
subscribe => File['/etc/munin/munin.conf.header'],
+ }
}
-
- file{'/etc/logrotate.d/munin':
- source => [ "puppet:///modules/site-munin/config/host/${fqdn}/logrotate",
- "puppet:///modules/site-munin/config/host/logrotate.$operatingsystem",
- "puppet:///modules/site-munin/config/host/logrotate",
- "puppet:///modules/munin/config/host/logrotate.$operatingsystem",
- "puppet:///modules/munin/config/host/logrotate" ],
- owner => root, group => 0, mode => 0644;
+ default: {
+ exec { 'set_modes_for_cgi':
+ command => 'chgrp apache /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 apache {} \; && find /var/www/html/munin/* -maxdepth 1 -type d -exec chmod -R g+w {} \;',
+ refreshonly => true,
+ subscribe => File['/etc/munin/munin.conf.header'],
+ }
}
+ }
+
+ file{'/etc/logrotate.d/munin':
+ source => [ "puppet:///modules/site-munin/config/host/${fqdn}/logrotate",
+ "puppet:///modules/site-munin/config/host/logrotate.$operatingsystem",
+ "puppet:///modules/site-munin/config/host/logrotate",
+ "puppet:///modules/munin/config/host/logrotate.$operatingsystem",
+ "puppet:///modules/munin/config/host/logrotate" ],
+ owner => root, group => 0, mode => 0644;
+ }
}
diff --git a/manifests/plugin.pp b/manifests/plugin.pp
index 52c77c2..a0989a8 100644
--- a/manifests/plugin.pp
+++ b/manifests/plugin.pp
@@ -8,7 +8,7 @@
define munin::plugin (
$ensure = "present",
$script_path_in = '',
- $config = '')
+ $config = '' )
{
include munin::plugin::scriptpaths
$real_script_path = $script_path_in ? { '' => $munin::plugin::scriptpaths::script_path, default => $script_path_in }
@@ -64,3 +64,4 @@ define munin::plugin (
}
}
}
+
diff --git a/manifests/plugin/deploy.pp b/manifests/plugin/deploy.pp
index 67cbfb8..0ab4e9f 100644
--- a/manifests/plugin/deploy.pp
+++ b/manifests/plugin/deploy.pp
@@ -1,37 +1,39 @@
-define munin::plugin::deploy($source = '', $ensure = 'present', $config = '') {
- $plugin_src = $ensure ? {
- 'present' => $name,
- 'absent' => $name,
- default => $ensure
- }
- $real_source = $source ? {
- '' => "munin/plugins/$plugin_src",
- default => $source
- }
- include munin::plugin::scriptpaths
- file { "munin_plugin_${name}":
- path => "$munin::plugin::scriptpaths::script_path/${name}",
- source => "puppet:///modules/$real_source",
- mode => 0755, owner => root, group => 0;
- }
+define munin::plugin::deploy( $source = '', $ensure = 'present', $config = '' )
+{
+ $plugin_src = $ensure ? {
+ 'present' => $name,
+ 'absent' => $name,
+ default => $ensure
+ }
+
+ $real_source = $source ? {
+ '' => "munin/plugins/$plugin_src",
+ default => $source
+ }
+
+ include munin::plugin::scriptpaths
+
+ file { "munin_plugin_${name}":
+ path => "$munin::plugin::scriptpaths::script_path/${name}",
+ source => "puppet://$server/modules/$real_source",
+ mode => 0755, owner => root, group => 0;
+ }
- case $kernel {
- openbsd: { $basic_require = File['/var/run/munin'] }
- default: { $basic_require = Package['munin-node'] }
- }
- if $require {
- File["munin_plugin_${name}"]{
- require => [ $basic_require, $require ],
- }
- } else {
- File["munin_plugin_${name}"]{
- require => $basic_require,
- }
- }
- # register the plugin
- if $require {
- munin::plugin{$name: ensure => $ensure, config => $config, require => $require }
- } else {
- munin::plugin{$name: ensure => $ensure, config => $config }
+ case $kernel {
+ openbsd: { $basic_require = File['/var/run/munin'] }
+ default: { $basic_require = Package['munin-node'] }
+ }
+
+ if $require { File["munin_plugin_${name}"]{ require => [ $basic_require, $require ] } }
+ else {
+ File["munin_plugin_${name}"]{
+ require => $basic_require,
}
+ }
+
+ # register the plugin
+ if $require { munin::plugin{$name: ensure => $ensure, config => $config, require => $require } }
+ else {
+ munin::plugin{$name: ensure => $ensure, config => $config }
+ }
}
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; }
+}