]> gitweb.fluxo.info Git - puppet-postfix.git/commitdiff
Use proper variable scope
authormh <mh@immerda.ch>
Thu, 16 Feb 2012 15:58:09 +0000 (16:58 +0100)
committermh <mh@immerda.ch>
Thu, 16 Feb 2012 15:58:09 +0000 (16:58 +0100)
Facts should be addressed with $::fqdn and so on.

manifests/hash.pp
manifests/init.pp
manifests/satellite.pp

index c8bb7c71064474806e3bad35ddc9a2f44eafceb3..6e2012f515cad3e955aee529166948dd0f83eef4 100644 (file)
@@ -29,23 +29,7 @@ Example usage:
 
 */
 define postfix::hash ($ensure="present", $source = false) {
-
-  # selinux labels differ from one distribution to another
-  case $operatingsystem {
-
-    RedHat, CentOS: {
-      case $lsbmajdistrelease {
-        "4":     { $postfix_seltype = "etc_t" }
-        "5":     { $postfix_seltype = "postfix_etc_t" }
-        default: { $postfix_seltype = undef }
-      }
-    }
-
-    default: {
-      $postfix_seltype = undef
-    }
-  }
-
+  include ::postfix
   case $source {
     false: {
       file {"${name}":
@@ -53,7 +37,7 @@ define postfix::hash ($ensure="present", $source = false) {
         mode    => 600,
         owner   => root,
         group   => root,
-        seltype => $postfix_seltype,
+        seltype => $postfix::postfix_seltype,
         require => Package["postfix"],
       }
     }
@@ -64,7 +48,7 @@ define postfix::hash ($ensure="present", $source = false) {
         owner   => root,
         group   => root,
         source  => $source,
-        seltype => $postfix_seltype,
+        seltype => $postfix::postfix_seltype,
         require => Package["postfix"],
       }
     }
@@ -74,7 +58,7 @@ define postfix::hash ($ensure="present", $source = false) {
     ensure  => $ensure,
     mode    => 600,
     require => [File["${name}"], Exec["generate ${name}.db"]],
-    seltype => $postfix_seltype,
+    seltype => $postfix::postfix_seltype,
   }
 
   exec {"generate ${name}.db":
index 63a50b958e8874d989ff3e7a32fd2bb75ad9a5f8..6d16efc78f3d2b31320b103276dfc612af50b12a 100644 (file)
 class postfix {
 
   # selinux labels differ from one distribution to another
-  case $operatingsystem {
+  case $::operatingsystem {
 
     RedHat, CentOS: {
-      case $lsbmajdistrelease {
+      case $::lsbmajdistrelease {
         "4":     { $postfix_seltype = "etc_t" }
         "5":     { $postfix_seltype = "postfix_etc_t" }
         default: { $postfix_seltype = undef }
@@ -93,7 +93,7 @@ class postfix {
     ensure => installed
   }
 
-  if $operatingsystem == 'debian' {
+  if $::operatingsystem == 'debian' {
     Package[mailx] { name => 'bsd-mailx' }
   }
 
@@ -131,10 +131,10 @@ class postfix {
     owner => "root",
     group => "root",
     mode => "0644",
-    content => $operatingsystem ? {
+    content => $::operatingsystem ? {
       Redhat => template("postfix/master.cf.redhat5.erb"),
       CentOS => template("postfix/master.cf.redhat5.erb"),
-      Debian => template("postfix/master.cf.debian-$lsbdistcodename.erb"),
+      Debian => template("postfix/master.cf.debian-${::lsbdistcodename}.erb"),
       Ubuntu => template("postfix/master.cf.debian-etch.erb"),
     },
     seltype => $postfix_seltype,
@@ -162,7 +162,7 @@ class postfix {
     "inet_interfaces": value => "${postfix_inet_interfaces}";
   }
 
-  case $operatingsystem {
+  case $::operatingsystem {
     RedHat, CentOS: {
       postfix::config {
         "sendmail_path": value => "/usr/sbin/sendmail.postfix";
index cb92a9f7e168a62fa3135ae48df0fe4ef8cf3448..99904dde320e84b2d1f98c945f8215e1a665b3d6 100644 (file)
@@ -25,7 +25,7 @@ class postfix::satellite {
 
   # If $valid_fqdn exists, use it to override $fqdn
   case $valid_fqdn {
-    "":      { $valid_fqdn = $fqdn }
+    "":      { $valid_fqdn = $::fqdn }
     default: { $fqdn = "${valid_fqdn}" }
   }