Merge remote-tracking branch 'cwarden/debian-squeeze-htmldir-fix' into master
authormh <mh@immerda.ch>
Tue, 10 Apr 2012 12:58:55 +0000 (14:58 +0200)
committermh <mh@immerda.ch>
Tue, 10 Apr 2012 12:59:45 +0000 (14:59 +0200)
Pull Request #4
Conflicts:
manifests/host.pp

16 files changed:
manifests/client.pp
manifests/client/base.pp
manifests/client/darwin.pp
manifests/client/debian.pp
manifests/client/openbsd.pp
manifests/host/cgi.pp
manifests/plugin.pp
manifests/plugin/deploy.pp
manifests/plugin/scriptpaths.pp
manifests/plugins/base.pp
manifests/plugins/interfaces.pp
manifests/plugins/physical.pp
manifests/plugins/setup.pp
manifests/register.pp
manifests/register/snmp.pp
templates/client.erb

index 99480f1..0ff5b79 100644 (file)
@@ -5,7 +5,7 @@
 
 class munin::client {
 
-    case $operatingsystem {
+    case $::operatingsystem {
         openbsd: { include munin::client::openbsd }
         darwin: { include munin::client::darwin }
         debian,ubuntu: { include munin::client::debian }
index 6b4bef9..0c7a62a 100644 (file)
@@ -12,11 +12,11 @@ class munin::client::base(
         mode => 0755, owner => root, group => 0;
     }
     file {'/etc/munin/munin-node.conf':
-        content => template("munin/munin-node.conf.$operatingsystem"),
+        content => template("munin/munin-node.conf.${::operatingsystem}"),
         notify => Service['munin-node'],
         mode => 0644, owner => root, group => 0,
     }
-    munin::register { $fqdn:
+    munin::register { $::fqdn:
         config => [ 'use_node_name yes', 'load.load.warning 5', 'load.load.critical 10'],
     }
     include munin::plugins::base
index 92787ec..264263d 100644 (file)
@@ -18,5 +18,5 @@ class munin::client::darwin {
   exec{"/sbin/SystemStarter start SNMP":
     noop => false,
   }
-  munin::register::snmp { $fqdn: }
+  munin::register::snmp { $::fqdn: }
 }
index 97f5fbf..903fb2d 100644 (file)
@@ -4,10 +4,10 @@ class munin::client::debian inherits munin::client::package {
 
     Service["munin-node"]{
         # sarge's munin-node init script has no status
-        hasstatus => $lsbdistcodename ? { sarge => false, default => true }
+        hasstatus => $::lsbdistcodename ? { sarge => false, default => true }
     }
     File["/etc/munin/munin-node.conf"]{
-            content => template("munin/munin-node.conf.$operatingsystem.$lsbdistcodename"),
+            content => template("munin/munin-node.conf.${::operatingsystem}.${::lsbdistcodename}"),
     }
     # workaround bug in munin_node_configure
     plugin { "postfix_mailvolume": ensure => absent }
index 7012c00..e1742d2 100644 (file)
@@ -1,7 +1,7 @@
 # currently we install munin on openbsd by targz
 # :(
 class munin::client::openbsd inherits munin::client::base {
-    if $operatingsystemrelease == '4.3' {
+    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;
@@ -32,7 +32,7 @@ class munin::client::openbsd inherits munin::client::base {
       owner => root, group  => 0, mode => 0755;
     }
     openbsd::rc_local{'munin-node':
-        binary => $operatingsystemrelease ? {
+        binary => $::operatingsystemrelease ? {
           '4.3' => '/opt/munin/sbin/munin-node',
           default => '/usr/local/sbin/munin-node'
         },
@@ -41,7 +41,7 @@ class munin::client::openbsd inherits munin::client::base {
     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 ? {
+        start => $::operatingsystemrelease ? {
           '4.3' => '/opt/munin/sbin/munin-node',
           default => '/usr/local/sbin/munin-node'
         },
index 6fd50df..283a243 100644 (file)
@@ -6,10 +6,10 @@ class munin::host::cgi {
     }
 
     file{'/etc/logrotate.d/munin':
-        source => [ "puppet:///modules/site-munin/config/host/${fqdn}/logrotate",
-                    "puppet:///modules/site-munin/config/host/logrotate.$operatingsystem",
+        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.${::operatingsystem}",
                     "puppet:///modules/munin/config/host/logrotate" ],
         owner => root, group => 0, mode => 0644;
     }
index 69b7322..9f799aa 100644 (file)
@@ -21,7 +21,7 @@ define munin::plugin (
             file { $plugin: ensure => absent, }
         }
         default: {
-            case $kernel {
+            case $::kernel {
                 openbsd: { $basic_require = File['/var/run/munin'] }
                 default: { $basic_require = Package['munin-node'] }
             }
@@ -35,7 +35,11 @@ define munin::plugin (
                 require => $real_require,
                 notify => Service['munin-node'];
             }
-
+            if ($::selinux == 'true') and (($::operatingsystem != 'CentOS') or ($::operatingsystem == 'CentOS' and $::lsbmajdistrelease != '5')){
+              File[$plugin]{
+                seltype => 'munin_etc_t',
+              }
+            }
         }
     }
     case $config {
index 67cbfb8..5003153 100644 (file)
@@ -15,7 +15,13 @@ define munin::plugin::deploy($source = '', $ensure = 'present', $config = '') {
             mode => 0755, owner => root, group => 0;
     }
 
-    case $kernel {
+    if ($::selinux == 'true') and (($::operatingsystem != 'CentOS') or ($::operatingsystem == 'CentOS' and $::lsbmajdistrelease != '5')){
+      File["munin_plugin_${name}"]{
+        seltype =>  'munin_exec_t',
+      }
+    }
+
+    case $::kernel {
         openbsd: { $basic_require = File['/var/run/munin'] }
         default: { $basic_require = Package['munin-node'] }
     }
index 164a17e..f4bd39b 100644 (file)
@@ -1,9 +1,9 @@
 class munin::plugin::scriptpaths {
-    case $operatingsystem {
+    case $::operatingsystem {
         gentoo: { $script_path =  "/usr/libexec/munin/plugins" }
         debian: { $script_path =  "/usr/share/munin/plugins" }
         centos: { $script_path =  "/usr/share/munin/plugins" }
-        openbsd: { $script_path = $operatingsystemrelease ? {
+        openbsd: { $script_path = $::operatingsystemrelease ? {
                                   '4.3' => '/opt/munin/lib/plugins/',
                                   default => '/usr/local/libexec/munin/plugins/'
                   } }
index 007579c..972a674 100644 (file)
@@ -7,7 +7,7 @@ class munin::plugins::base {
   }
   include munin::plugins::interfaces
 
-  case $kernel {
+  case $::kernel {
     openbsd: { include munin::plugins::openbsd }
     linux: {
       case $vserver {
index 18a713b..b2c448b 100644 (file)
@@ -5,7 +5,7 @@ class munin::plugins::interfaces  {
   munin::plugin {
     $ifs: ensure => "if_";
   }
-  case $operatingsystem {
+  case $::operatingsystem {
     openbsd: {
       $if_errs = regsubst(split($interfaces, " |,"), "(.+)", "if_errcoll_\\1")
       munin::plugin{
index ac050a5..a1c27a7 100644 (file)
@@ -1,5 +1,5 @@
 class munin::plugins::physical  { 
-  case $kernel {
+  case $::kernel {
     linux: { munin::plugin { iostat: } }
   }
 }
index c88f9e0..caf2e28 100644 (file)
@@ -11,7 +11,7 @@ class munin::plugins::setup {
       mode => 0644, owner => root, group => 0,
       notify => Service['munin-node'],
   }
-  case $kernel {
+  case $::kernel {
     openbsd: {
       File['/etc/munin/plugin-conf.d/munin-node']{
         before => File['/var/run/munin'],
index 3c542ff..254eaaf 100644 (file)
@@ -16,8 +16,8 @@ define munin::register (
     $hiera_munin_host = hiera('munin_host','')
     $munin_host_real = $host ? {
         'absent' =>  $hiera_munin_host ? {
-                        '' => $fqdn,
-                        'fqdn' => $fqdn,
+                        '' => $::fqdn,
+                        'fqdn' => $::fqdn,
                         default => $hiera_munin_host
                     },
         default => $host
index a4d0d88..acd1e03 100644 (file)
@@ -5,7 +5,7 @@ define munin::register::snmp (
 )
 {
     $fhost = $name
-    $munin_host_real = $fqdn
+    $munin_host_real = $::fqdn
     $client_type = 'snmp'
     $config = [ 'use_node_name no' ]
 
index 3e8ab39..8c93cc5 100644 (file)
@@ -1,7 +1,7 @@
 <%
        # Downcase all information
-       dom = domain.downcase
-       host = hostname.downcase
+       dom = scope.lookupvar('::domain').downcase
+       host = scope.lookupvar('::hostname').downcase
 %>
 
 ### Munin client from Puppet template