Commit 0537c3b4 authored by Marc Fournier's avatar Marc Fournier
Browse files

Merge pull request #21 from mfournier/augeas-lens-incl

Augeas lens incl
parents 5537ec1e 9fea87fe
Loading
Loading
Loading
Loading
+5 −0
Changes for manifests/augeas.pp: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -4,4 +4,9 @@ class postfix::augeas {
    lens_source => 'puppet:///modules/postfix/lenses/postfix_transport.aug',
    test_source => 'puppet:///modules/postfix/lenses/test_postfix_transport.aug',
  }
  augeas::lens {'postfix_virtual':
    ensure      => present,
    lens_source => 'puppet:///modules/postfix/lenses/postfix_virtual.aug',
    test_source => 'puppet:///modules/postfix/lenses/test_postfix_virtual.aug',
  }
}

manifests/classes/postfix-ldap.pp

deleted100644 → 0
+0 −19
Changes for manifests/classes/postfix-ldap.pp: 0 added lines, 19 removed lines.
Original line number Diff line number Diff line
class postfix::ldap inherits postfix {
  Postfix::Config["alias_maps"] {
    value => "'hash:/etc/aliases, ldap:/etc/postfix/ldap-aliases.cf'",
  }

  package {"postfix-ldap": }

  if ! $postfix_ldap_base {
    fail 'Missing $postfix_ldap_base !'
  }

  file {"/etc/postfix/ldap-aliases.cf":
    ensure  => present,
    owner   => root,
    group   => postfix,
    content => template("postfix/postfix-ldap-aliases.cf.erb"),
    require => Package["postfix-ldap"],
  }
}
+0 −35
Changes for manifests/classes/postfix-mailman.pp: 0 added lines, 35 removed lines.
Original line number Diff line number Diff line
#
# == 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_smtp_listen = "0.0.0.0"
  include postfix

  postfix::config {
    "virtual_alias_maps":                   value => "hash:/etc/postfix/virtual";
    "transport_maps":                       value => "hash:/etc/postfix/transport";
    "mailman_destination_recipient_limit":  value => "1";
  }

  postfix::hash { "/etc/postfix/virtual":
    ensure => present,
  }

  postfix::hash { "/etc/postfix/transport":
    ensure => present,
  }

}

manifests/classes/postfix-mta.pp

deleted100644 → 0
+0 −61
Changes for manifests/classes/postfix-mta.pp: 0 added lines, 61 removed lines.
Original line number Diff line number Diff line
#
# == Class: postfix::mta
#
# This class configures a minimal MTA, listening on
# $postfix_smtp_listen (default to localhost) and delivering mail to
# $postfix_mydestination (default to $fqdn).
#
# A valid relay host is required ($postfix_relayhost) for outbound email.
#
# transport & virtual maps get configured and can be populated with
# postfix::transport and postfix::virtual
#
# 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_smtp_listen = "0.0.0.0"
#     $postfix_mydestination = "\$myorigin, myapp.example.com"
#
#     include postfix::mta
#
#     postfix::transport { "myapp.example.com":
#       ensure => present,
#       destination => "local:",
#     }
#   }
#
class postfix::mta {

  case $postfix_relayhost {
    "":   { fail("Required \$postfix_relayhost variable is not defined.") }
  }

  case $postfix_mydestination {
    "": { $postfix_mydestination = "\$myorigin" }
  }

  include postfix

  postfix::config {
    "mydestination":                        value => $postfix_mydestination;
    "mynetworks":                           value => "127.0.0.0/8";
    "relayhost":                            value => $postfix_relayhost;
    "virtual_alias_maps":                   value => "hash:/etc/postfix/virtual";
    "transport_maps":                       value => "hash:/etc/postfix/transport";
  }

  postfix::hash { "/etc/postfix/virtual":
    ensure => present,
  }

  postfix::hash { "/etc/postfix/transport":
    ensure => present,
  }

}
+0 −38
Changes for manifests/classes/postfix-satellite.pp: 0 added lines, 38 removed lines.
Original line number Diff line number Diff line
#
# == 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.
#
# Parameters:
# - *valid_fqdn*
# - every global variable which works for class "postfix" will work here.
#
# Example usage:
#
#   node "toto.local.lan" {
#     $postfix_relayhost = "mail.example.com"
#     $valid_fqdn = "toto.example.com"
#     $root_mail_recipient = "the.sysadmin@example.com"
#
#     include postfix::satellite
#   }
#
class postfix::satellite {

  # If $valid_fqdn exists, use it to override $fqdn
  case $valid_fqdn {
    "":      { $valid_fqdn = $fqdn }
    default: { $fqdn = "${valid_fqdn}" }
  }

  include postfix::mta

  postfix::virtual {"@${valid_fqdn}":
    ensure      => present,
    destination => "root",
  }
}
Loading