summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2011-11-05 14:14:32 +0100
committermh <mh@immerda.ch>2011-11-05 14:14:32 +0100
commit9b161f0c61bbd30960e663eceef8f1b35f633507 (patch)
tree340e8f17084fc4b71478fb9b098f8d964d8fa62d /manifests
parent33380e238f3ac37ac79f30485fdebbc5dd10170b (diff)
use hiera to configure munin node specific things
Diffstat (limited to 'manifests')
-rw-r--r--manifests/client.pp7
-rw-r--r--manifests/client/base.pp8
-rw-r--r--manifests/register.pp10
-rw-r--r--manifests/register/snmp.pp5
4 files changed, 8 insertions, 22 deletions
diff --git a/manifests/client.pp b/manifests/client.pp
index 141c916..99480f1 100644
--- a/manifests/client.pp
+++ b/manifests/client.pp
@@ -5,13 +5,6 @@
class munin::client {
- $munin_port_real = $munin_port ? { '' => 4949, default => $munin_port }
- $munin_host_real = $munin_host ? {
- '' => '*',
- 'fqdn' => '*',
- default => $munin_host
- }
-
case $operatingsystem {
openbsd: { include munin::client::openbsd }
darwin: { include munin::client::darwin }
diff --git a/manifests/client/base.pp b/manifests/client/base.pp
index 17387e8..6b4bef9 100644
--- a/manifests/client/base.pp
+++ b/manifests/client/base.pp
@@ -1,4 +1,6 @@
-class munin::client::base {
+class munin::client::base(
+ $munin_allow = hiera('munin_allow','127.0.0.1')
+) {
service { 'munin-node':
ensure => running,
enable => true,
@@ -9,10 +11,6 @@ class munin::client::base {
ensure => directory,
mode => 0755, owner => root, group => 0;
}
- $real_munin_allow = $munin_allow ? {
- '' => '127.0.0.1',
- default => $munin_allow
- }
file {'/etc/munin/munin-node.conf':
content => template("munin/munin-node.conf.$operatingsystem"),
notify => Service['munin-node'],
diff --git a/manifests/register.pp b/manifests/register.pp
index 78d13d3..3c542ff 100644
--- a/manifests/register.pp
+++ b/manifests/register.pp
@@ -9,18 +9,16 @@ define munin::register (
$client_type = 'client'
$munin_port_real = $port ? {
- 'absent' => $munin_port ? {
- '' => 4949,
- default => $munin_port
- },
+ 'absent' => hiera('munin_port','4949'),
default => $port
}
+ $hiera_munin_host = hiera('munin_host','')
$munin_host_real = $host ? {
- 'absent' => $munin_host ? {
+ 'absent' => $hiera_munin_host ? {
'' => $fqdn,
'fqdn' => $fqdn,
- default => $munin_host
+ default => $hiera_munin_host
},
default => $host
}
diff --git a/manifests/register/snmp.pp b/manifests/register/snmp.pp
index c45adb0..a4d0d88 100644
--- a/manifests/register/snmp.pp
+++ b/manifests/register/snmp.pp
@@ -10,10 +10,7 @@ define munin::register::snmp (
$config = [ 'use_node_name no' ]
$munin_port_real = $port ? {
- 'absent' => $munin_port ? {
- '' => 4949,
- default => $munin_port
- },
+ 'absent' => hiera('munin_port','4949'),
default => $port
}