switch postfix smarthost config to classparams
[mirror/dsa-puppet.git] / modules / postfix / manifests / init.pp
index 88591a9..000522d 100644 (file)
@@ -1,10 +1,23 @@
+# postfix class
+# @param use_smarthost use the smarthost
+# @param smarthost host to relay through (if set and use_smarthost)
 class postfix(
+  Optional[String] $smarthost,
+  Boolean $use_smarthost = true,
   Boolean $manage_maincf = true,
 ) {
   package { 'postfix':
     ensure => installed
   }
 
+  if $use_smarthost {
+    if ! smarthost {
+      fail('No smarthost set but use_smarthost is true')
+    }
+  } else {
+    $heavy = true
+  }
+
   service { 'postfix':
     ensure => running
   }