]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
some readability cleanup
authorStephen Gran <steve@lobefin.net>
Sun, 18 Mar 2012 15:31:49 +0000 (15:31 +0000)
committerStephen Gran <steve@lobefin.net>
Sun, 18 Mar 2012 15:31:49 +0000 (15:31 +0000)
Signed-off-by: Stephen Gran <steve@lobefin.net>
manifests/site.pp
modules/acpi/manifests/init.pp [new file with mode: 0644]
modules/apache2/manifests/backports_mirror.pp
modules/apache2/manifests/ftp-upcoming_mirror.pp
modules/apache2/manifests/security_mirror.pp
modules/apache2/manifests/www_mirror.pp
modules/ferm/manifests/per-host.pp

index 9d9d2b8b7592564dba1fe6c900a0228edb916424..b4f44c26e379cf9e90a692a4e77820b9f0c82578 100644 (file)
@@ -15,9 +15,9 @@ Exec {
 
 node default {
     $localinfo = yamlinfo('*', "/etc/puppet/modules/debian-org/misc/local.yaml")
-    $nodeinfo  = nodeinfo($fqdn, "/etc/puppet/modules/debian-org/misc/local.yaml")
+    $nodeinfo  = nodeinfo($::fqdn, "/etc/puppet/modules/debian-org/misc/local.yaml")
     $allnodeinfo = allnodeinfo("sshRSAHostKey ipHostNumber", "purpose mXRecord physicalHost purpose")
-    notice( sprintf("hoster for %s is %s", $fqdn, getfromhash($nodeinfo, 'hoster', 'name') ) )
+    notice( sprintf("hoster for %s is %s", $::fqdn, getfromhash($nodeinfo, 'hoster', 'name') ) )
 
     include munin-node
     include syslog-ng
@@ -29,53 +29,41 @@ node default {
     include ntp
     include ntpdate
     include ssl
-
     include motd
 
-    case $hostname {
+    case $::hostname {
         finzi,fano,fasch,field:    { include kfreebsd }
     }
 
-    case $smartarraycontroller {
-        "true":    { include debian-proliant }
-    }
-    case $kvmdomain {
-        "true": {
-            case $debarchitecture {
-                kfreebsd-amd64,kfreebsd-i386: {
-                }
-                default: {
-                    package { acpid: ensure => installed }
-                    case $lsbdistcodename {
-                        'lenny':    { }
-                        default:    { package { acpi-support-base: ensure => installed } }
-                    }
-                }
-            }
-        }
+    if $::smartarraycontroller {
+        include debian-proliant
+    }
+
+    if $::productname == 'PowerEdge 2850' {
+        include megactl
     }
-    case $mptraid {
-        "true":    { include "raidmpt" }
+
+    if $::mptraid {
+        include raidmpt
     }
-    case $productname {
-        "PowerEdge 2850": { include megactl }
+
+    if $::kvmdomain {
+        include acpi
     }
 
-    case $mta {
-        "exim4":   {
-             case getfromhash($nodeinfo, 'heavy_exim') {
-                  true:  { include exim::mx }
-                  default: { include exim }
-             }
+    if $::mta == 'exim4' {
+        case getfromhash($nodeinfo, 'heavy_exim') {
+             true:  { include exim::mx }
+             default: { include exim }
         }
     }
 
-    case getfromhash($nodeinfo, 'puppetmaster') {
-        true: { include puppetmaster }
+    if getfromhash($nodeinfo, 'puppetmaster') {
+        include puppetmaster
     }
 
-    case getfromhash($nodeinfo, 'muninmaster') {
-        true: { include munin-node::master }
+    if getfromhash($nodeinfo, 'muninmaster') {
+        include munin-node::master
     }
 
     case getfromhash($nodeinfo, 'nagiosmaster') {
@@ -83,93 +71,88 @@ node default {
         default: { include nagios::client }
     }
 
-    case $apache2 {
-         "true":  {
-              case getfromhash($nodeinfo, 'apache2_security_mirror') {
-                     true:    { include apache2::security_mirror }
-              }
-              case getfromhash($nodeinfo, 'apache2_www_mirror') {
-                     true:    { include apache2::www_mirror }
-              }
-              case getfromhash($nodeinfo, 'apache2_backports_mirror') {
-                     true:    { include apache2::backports_mirror }
-              }
-              case getfromhash($nodeinfo, 'apache2_ftp-upcoming_mirror') {
-                     true:    { include apache2::ftp-upcoming_mirror }
-              }
-              include apache2
+    if $::apache2 {
+         if getfromhash($nodeinfo, 'apache2_security_mirror') {
+                include apache2::security_mirror
+         }
+         if getfromhash($nodeinfo, 'apache2_www_mirror') {
+                include apache2::www_mirror
+         }
+         if getfromhash($nodeinfo, 'apache2_backports_mirror') {
+                include apache2::backports_mirror
          }
+         if getfromhash($nodeinfo, 'apache2_ftp-upcoming_mirror') {
+                include apache2::ftp-upcoming_mirror
+         }
+         include apache2
     }
 
-    case $rsyncd {
-         "true": { include rsyncd-log }
+    if $::rsyncd {
+        include rsyncd-log
     }
 
 
-    case getfromhash($nodeinfo, 'buildd') {
-         true:  {
-             include buildd
-         }
+    if getfromhash($nodeinfo, 'buildd') {
+        include buildd
     }
 
-    case $hostname {
+    case $::hostname {
         ravel,senfl,orff,draghi,diamond: { include named::authoritative }
-        geo1,geo2,geo3:                          { include named::geodns }
-        liszt:                                   { include named::recursor }
+        geo1,geo2,geo3:                  { include named::geodns }
+        liszt:                           { include named::recursor }
     }
-    case $hostname {
+
+    case $::hostname {
         franck,master,lobos,samosa,spohr,widor:   { include unbound }
     }
-    case $lsbdistcodename {
-        'lenny':    { }
-        default:    { include unbound }
+
+    if $::lsbdistcodename != 'lenny' {
+        include unbound
     }
+
     include resolv
 
-    case $kernel {
-        Linux: {
-            include ferm
-            include ferm::per-host
-            case $rsyncd {
-                "true": { include ferm::rsync }
-            }
-        }
+    if $::kernel == 'Linux' {
+        include ferm
+        include ferm::per-host
     }
 
-    case $hostname {
+    case $::hostname {
         diabelli,nono,spohr: { include dacs }
     }
 
-    case $hostname {
+    case $::hostname {
         beethoven,duarte,spohr,stabile: {
             include nfs-server
         }
     }
 
-    case $brokenhosts {
-        "true":    { include hosts }
+    if $::brokenhosts {
+        include hosts
     }
-    case $portforwarder_user_exists {
-        "true":    { include portforwarder }
+
+    if $::portforwarder_user_exists {
+        include portforwarder
     }
 
     include samhain
 
-    case $hostname {
+    case $::hostname {
         byrd,schuetz,tchaikovsky,draghi,quantz,lamb,locke,rautavaara,rietz: {
             include krb
         }
     }
 
-    case $hostname {
+    case $::hostname {
         chopin,geo3,soler,wieck: {
             include debian-radvd
         }
     }
 
-    case $kernel {
-        Linux: { include entropykey }
+    if $::kernel == 'Linux' {
+        include entropykey
     }
+
     if $::postgres84 == "true" {
         include postgres
     } elsif $::postgres90 == "true" {
diff --git a/modules/acpi/manifests/init.pp b/modules/acpi/manifests/init.pp
new file mode 100644 (file)
index 0000000..c12847f
--- /dev/null
@@ -0,0 +1,13 @@
+class acpi {
+    if $debarchitecture not in ['kfreebsd-amd64', kfreebsd-i386'] {
+        package {
+            acpid: ensure => installed
+        }
+
+        if $lsbdistcodename != 'lenny' {
+            package {
+                acpi-support-base: ensure => installed
+            }
+        }
+    }
+}
index 615d050eb507d51be587c2004384c90727b44589..47b2a2dc863cedf0ce606f820f1c361776022994 100644 (file)
@@ -1,4 +1,5 @@
-class apache2::backports_mirror inherits apache2 {
+class apache2::backports_mirror {
+    include apache2
     file {
         "/etc/apache2/sites-available/backports.debian.org":
             source  => [ "puppet:///modules/apache2/per-host/$fqdn/etc/apache2/sites-available/backports.debian.org",
index 66a9cce2916f22073ef8265f53e270da7451eb82..aa3610c4ad921e5907026620ec24ec176fc7c3f1 100644 (file)
@@ -1,4 +1,5 @@
-class apache2::ftp-upcoming_mirror inherits apache2 {
+class apache2::ftp-upcoming_mirror {
+    include apache2
     file {
         "/etc/apache2/sites-available/ftp-upcoming.debian.org":
             source  => [ "puppet:///modules/apache2/per-host/$fqdn/etc/apache2/sites-available/ftp-upcoming.debian.org",
index fba5ad4742712079dd93079d2784177919cb865b..853b9f89660035344eed69f81277060919f4f648 100644 (file)
@@ -1,4 +1,5 @@
-class apache2::security_mirror inherits apache2 {
+class apache2::security_mirror {
+    include apache2
     file {
         "/etc/apache2/sites-available/security.debian.org":
             source  => [ "puppet:///modules/apache2/per-host/$fqdn/etc/apache2/sites-available/security.debian.org",
index ac4ee3c45428eb1f86d03c1f55af3dbf9e40f8ed..136e571e54a4b51ba626b944c6c7b92ff33f4690 100644 (file)
@@ -1,4 +1,5 @@
-class apache2::www_mirror inherits apache2 {
+class apache2::www_mirror {
+    include apache2
     file {
         "/etc/apache2/sites-available/www.debian.org":
             source  => [ "puppet:///modules/apache2/per-host/$fqdn/etc/apache2/sites-available/www.debian.org",
index 743dbd162f45e6ab0ecdacd70a12781e453ce058..a5717e15d4b3dbf76f4d87142b0d0c8ec23a8a12 100644 (file)
@@ -1,17 +1,17 @@
 class ferm::per-host {
-    case $hostname {
+    case $::hostname {
         ancina,zandonai,zelenka: {
             include ferm::zivit
         }
     }
 
-    case $hostname {
+    case $::hostname {
         chopin,franck,gluck,kassia,klecker,lobos,morricone,ravel,ries,rietz,saens,schein,santoro,steffani,valente,villa,wieck,stabile,bizet: {
             include ferm::ftp
         }
     }
 
-    case $hostname {
+    case $::hostname {
         piatti,samosa: {
             @ferm::rule { "dsa-udd-stunnel":
                 description  => "port 8080 for udd stunnel",
@@ -221,7 +221,7 @@ class ferm::per-host {
     }
 
     # redirect snapshot into varnish
-    case $hostname {
+    case $::hostname {
         sibelius: {
             @ferm::rule { "dsa-snapshot-varnish":
                 rule            => '&SERVICE(tcp, 6081)',
@@ -243,6 +243,10 @@ class ferm::per-host {
             }
         }
     }
+
+    if $::rsyncd {
+        include ferm::rsync
+    }
 }
 
 # vim:set et: