Unverified Commit 7985c046 authored by Kenyon Ralph's avatar Kenyon Ralph Committed by GitHub
Browse files

Merge pull request #400 from peelman/master

Allow mailaliases to be managed via hiera
parents 4ab126b4 c096edde
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -102,6 +102,7 @@ The following parameters are available in the `postfix` class:
* [`ldap_options`](#-postfix--ldap_options)
* [`ldap_packages`](#-postfix--ldap_packages)
* [`lookup_table_type`](#-postfix--lookup_table_type)
* [`mailaliases`](#-postfix--mailaliases)
* [`mail_user`](#-postfix--mail_user)
* [`mailman`](#-postfix--mailman)
* [`mailx_ensure`](#-postfix--mailx_ensure)
@@ -275,6 +276,16 @@ Type has to be supported by system, see "postconf -m" for supported types.

Default value: `'hash'`

##### <a name="-postfix--mailaliases"></a>`mailaliases`

Data type: `Hash`

A hash of postfix::mailalias resources. The hash containing optional configuration values for main.cf.
The values are configured using postfix::mailalias.
Example: `{'nobody': {'ensure': 'present', 'recipient': 'root'}}`

Default value: `{}`

##### <a name="-postfix--mail_user"></a>`mail_user`

Data type: `String`
+12 −0
Original line number Diff line number Diff line
@@ -93,6 +93,11 @@
#   Table format type as described in http://www.postfix.org/DATABASE_README.html#types.
#   Type has to be supported by system, see "postconf -m" for supported types.
#
# @param mailaliases
#   A hash of postfix::mailalias resources. The hash containing optional configuration values for main.cf.
#   The values are configured using postfix::mailalias.
#   Example: `{'nobody': {'ensure': 'present', 'recipient': 'root'}}`
#
# @param mail_user
#   A string defining the mail user, and optionally group, to execute external commands as.
#   This parameter maps to the user parameter (pipe(8)).
@@ -267,6 +272,7 @@ class postfix (
  Optional[String]                     $ldap_options          = undef,
  Array[String[1]]                     $ldap_packages         = [],
  String                               $lookup_table_type     = 'hash',
  Hash                                 $mailaliases           = {},
  String                               $mail_user             = 'vmail',       # postfix_mail_user
  Boolean                              $mailman               = false,
  String                               $mailx_ensure          = 'present',
@@ -333,6 +339,12 @@ class postfix (
    }
  }

  $mailaliases.each |$key, $value| {
    postfix::mailalias { $key:
      * => $value,
    }
  }

  $transports.each |$key, $value| {
    postfix::transport { $key:
      * => $value,