aboutsummaryrefslogtreecommitdiff
path: root/manifests/classes
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/classes')
-rw-r--r--manifests/classes/postfix-mailman.pp16
-rw-r--r--manifests/classes/postfix-mta.pp29
-rw-r--r--manifests/classes/postfix-satellite.pp27
-rw-r--r--manifests/classes/postfix.pp21
4 files changed, 64 insertions, 29 deletions
diff --git a/manifests/classes/postfix-mailman.pp b/manifests/classes/postfix-mailman.pp
index ace2af1..c6c7981 100644
--- a/manifests/classes/postfix-mailman.pp
+++ b/manifests/classes/postfix-mailman.pp
@@ -1,3 +1,19 @@
+#
+# == Class: postfix::mailman
+#
+# Configures a basic smtp server, able to work for the mailman mailing-list
+# manager.
+#
+# Parameters:
+# - every global variable which works for class "postfix" will work here.
+#
+# Example usage:
+#
+# node "toto.example.com" {
+# include mailman
+# include postfix::mailman
+# }
+#
class postfix::mailman {
$postfix_ng_smtp_listen = "0.0.0.0"
include postfix
diff --git a/manifests/classes/postfix-mta.pp b/manifests/classes/postfix-mta.pp
index 451ac36..9046bad 100644
--- a/manifests/classes/postfix-mta.pp
+++ b/manifests/classes/postfix-mta.pp
@@ -1,4 +1,5 @@
-#########################################################################
+#
+# == Class: postfix::mta
#
# This class configures a minimal MTA, listening on
# $postfix_ng_smtp_listen (default to localhost) and delivering mail to
@@ -9,22 +10,26 @@
# transport & virtual maps get configured and can be populated with
# postfix::transport and postfix::virtual
#
-# Example:
+# Parameters:
+# - *$postfix_relayhost*
+# - *$postfix_mydestination*
+# - every global variable which works for class "postfix" will work here.
+#
+# Example usage:
#
-# node "toto.example.com" {
-# $postfix_relayhost = "mail.example.com"
-# $postfix_ng_smtp_listen = "0.0.0.0"
-# $postfix_mydestination = "\$myorigin, myapp.example.com"
+# node "toto.example.com" {
+# $postfix_relayhost = "mail.example.com"
+# $postfix_ng_smtp_listen = "0.0.0.0"
+# $postfix_mydestination = "\$myorigin, myapp.example.com"
#
-# include postfix::mta
+# include postfix::mta
#
-# postfix::transport { "myapp.example.com":
-# ensure => present,
-# destination => "local:",
+# postfix::transport { "myapp.example.com":
+# ensure => present,
+# destination => "local:",
+# }
# }
-# }
#
-
class postfix::mta {
case $postfix_relayhost {
diff --git a/manifests/classes/postfix-satellite.pp b/manifests/classes/postfix-satellite.pp
index a3ea320..cb92a9f 100644
--- a/manifests/classes/postfix-satellite.pp
+++ b/manifests/classes/postfix-satellite.pp
@@ -1,26 +1,29 @@
-#########################################################################
+#
+# == Class: postfix::satellite
#
# This class configures all local email (cron, mdadm, etc) to be forwarded
# to $root_mail_recipient, using $postfix_relayhost as a relay.
-#
+#
# $valid_fqdn can be set to override $fqdn in the case where the FQDN is
# not recognized as valid by the destination server.
#
-# All other parameters for postfix::mta are valid.
+# Parameters:
+# - *valid_fqdn*
+# - every global variable which works for class "postfix" will work here.
+#
+# Example usage:
#
-# Example:
+# node "toto.local.lan" {
+# $postfix_relayhost = "mail.example.com"
+# $valid_fqdn = "toto.example.com"
+# $root_mail_recipient = "the.sysadmin@example.com"
#
-# node "toto.local.lan" {
-# $postfix_relayhost = "mail.example.com"
-# $valid_fqdn = "toto.example.com"
-# $root_mail_recipient = "the.sysadmin@example.com"
+# include postfix::satellite
+# }
#
-# include postfix::satellite
-# }
-
class postfix::satellite {
- # If $fake_fqdn exists, use it to override $fqdn
+ # If $valid_fqdn exists, use it to override $fqdn
case $valid_fqdn {
"": { $valid_fqdn = $fqdn }
default: { $fqdn = "${valid_fqdn}" }
diff --git a/manifests/classes/postfix.pp b/manifests/classes/postfix.pp
index d79199e..8c4173e 100644
--- a/manifests/classes/postfix.pp
+++ b/manifests/classes/postfix.pp
@@ -1,11 +1,23 @@
-#########################################################################
+#
+# == Class: postfix
#
# This class provides a basic setup of postfix with local and remote
# delivery and an SMTP server listening on the loopback interface.
#
-
+# Parameters:
+# - *$postfix_ng_smtp_listen*: address on which the smtp service will listen to. defaults to 127.0.0.1
+# - *$root_mail_recipient*: who will recieve root's emails. defaults to "nobody"
+#
+# Example usage:
+#
+# node "toto.example.com" {
+# $postfix_ng_smtp_listen = "192.168.1.10"
+# include postfix
+# }
+#
class postfix {
+ # selinux labels differ from one distribution to another
case $operatingsystem {
RedHat: {
@@ -46,7 +58,6 @@ class postfix {
}
# Aliases
-
file { "/etc/aliases":
ensure => present,
content => "# file managed by puppet\n",
@@ -55,6 +66,7 @@ class postfix {
notify => Exec["newaliases"],
}
+ # Aliases
exec { "newaliases":
command => "/usr/bin/newaliases",
refreshonly => true,
@@ -63,7 +75,6 @@ class postfix {
}
# Config files
-
file { "/etc/postfix/master.cf":
ensure => present,
owner => "root",
@@ -77,6 +88,7 @@ class postfix {
require => Package["postfix"],
}
+ # Config files
file { "/etc/postfix/main.cf":
ensure => present,
owner => "root",
@@ -89,7 +101,6 @@ class postfix {
}
# Default configuration parameters
-
postfix::config {
"myorigin": value => "${fqdn}";
"alias_maps": value => "hash:/etc/aliases";