summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2012-06-13 20:40:57 -0300
committermh <mh@immerda.ch>2012-06-13 20:40:57 -0300
commitc95f0b2fcf4f35b1a7ae3ad9c04600a32ab2bb43 (patch)
treeb643e6144b1fe32cdba08692cce075a0fc2aa2b5 /manifests
parentb4a30b6255ca495b98803317ad691fa1a26a4987 (diff)
migrate away from hiera stuff
Diffstat (limited to 'manifests')
-rw-r--r--manifests/client.pp16
-rw-r--r--manifests/client/base.pp6
-rw-r--r--manifests/host.pp2
-rw-r--r--manifests/register.pp19
-rw-r--r--manifests/register/snmp.pp9
5 files changed, 19 insertions, 33 deletions
diff --git a/manifests/client.pp b/manifests/client.pp
index 79d275e..934d23a 100644
--- a/manifests/client.pp
+++ b/manifests/client.pp
@@ -4,9 +4,11 @@
# Adapted and improved by admin(at)immerda.ch
class munin::client(
- $allow = hiera('munin_client_allow',['127.0.0.1']),
- $host = hiera('munin_host','*'),
- $port = hiera('munin_port','4949')
+ $allow = [ '127.0.0.1' ],
+ $host = '*',
+ $port = '4949',
+ $manage_shorewall = false,
+ $shorewall_collector_source = 'net'
) {
case $::operatingsystem {
openbsd: { include munin::client::openbsd }
@@ -16,7 +18,11 @@ class munin::client(
centos: { include munin::client::package }
default: { include munin::client::base }
}
- if hiera('use_shorewall',false) {
- include shorewall::rules::munin
+ if $munin::client::manage_shorewall {
+ class{'shorewall::rules::munin':
+ munin_port => $port,
+ munin_collector => delete($allow,'127.0.0.1'),
+ collector_source => $shorewall_collector_source,
+ }
}
}
diff --git a/manifests/client/base.pp b/manifests/client/base.pp
index 80a25c5..1cba47b 100644
--- a/manifests/client/base.pp
+++ b/manifests/client/base.pp
@@ -1,6 +1,4 @@
-class munin::client::base(
- $munin_allow = hiera('munin_allow','127.0.0.1')
-) {
+class munin::client::base {
service { 'munin-node':
ensure => running,
enable => true,
@@ -17,6 +15,8 @@ class munin::client::base(
mode => 0644, owner => root, group => 0,
}
munin::register { $::fqdn:
+ host => $munin::client::host,
+ port => $munin::client::port,
config => [ 'use_node_name yes', 'load.load.warning 5', 'load.load.critical 10'],
}
include munin::plugins::base
diff --git a/manifests/host.pp b/manifests/host.pp
index 524cddf..b828e35 100644
--- a/manifests/host.pp
+++ b/manifests/host.pp
@@ -37,7 +37,7 @@ class munin::host(
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 hiera('use_shorewall',false) {
+ if $munin::host::manage_shorewall {
include shorewall::rules::out::munin
}
}
diff --git a/manifests/register.pp b/manifests/register.pp
index 14019d0..2645542 100644
--- a/manifests/register.pp
+++ b/manifests/register.pp
@@ -1,6 +1,6 @@
define munin::register (
- $host = 'absent',
- $port = 'absent',
+ $host = $::fqdn,
+ $port = '4949',
$description = 'absent',
$config = []
)
@@ -8,21 +8,6 @@ define munin::register (
$fhost = $name
$client_type = 'client'
- $munin_port_real = $port ? {
- 'absent' => hiera('munin_port','4949'),
- default => $port
- }
-
- $hiera_munin_host = hiera('munin_host','')
- $munin_host_real = $host ? {
- 'absent' => $hiera_munin_host ? {
- '' => $::fqdn,
- 'fqdn' => $::fqdn,
- default => $hiera_munin_host
- },
- default => $host
- }
-
@@concat::fragment{ "munin_client_${fhost}_${munin_port_real}":
target => '/etc/munin/munin.conf',
content => template("munin/client.erb"),
diff --git a/manifests/register/snmp.pp b/manifests/register/snmp.pp
index 3007b67..78c3e91 100644
--- a/manifests/register/snmp.pp
+++ b/manifests/register/snmp.pp
@@ -1,18 +1,13 @@
define munin::register::snmp (
$community = 'public',
$description = 'absent',
- $port = 'absent'
+ $port = '4949',
+ $host = $::fqdn
) {
$fhost = $name
- $munin_host_real = $::fqdn
$client_type = 'snmp'
$config = [ 'use_node_name no' ]
- $munin_port_real = $port ? {
- 'absent' => hiera('munin_port','4949'),
- default => $port
- }
-
exec { "munin_register_snmp_${fhost}":
command => "munin-node-configure --snmp ${fhost} --snmpcommunity ${community} --shell | sh",
unless => "ls /etc/munin/plugins/snmp_${fhost}_* &> /dev/null",