diff --git a/manifests/init.pp b/manifests/init.pp index 5b97d94c6ba66a2873e146037bf34d62d570d58c..850e702750552c46222712d8bc45d825e0e573f2 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -34,6 +34,7 @@ class postfix ( $mynetworks = undef, # postfix_mynetworks $mta = false, $satellite = false, + $mailman = false, ) inherits postfix::params { validate_string($smtp_listen) @@ -53,10 +54,16 @@ class postfix ( validate_bool($mta) validate_bool($satellite) + validate_bool($mailman) + + $_smtp_listen = $mailman ? { + true => '0.0.0.0', + default => $smtp_listen, + } class { 'postfix::packages': } -> class { 'postfix::files': - smtp_listen => $smtp_listen, + smtp_listen => $_smtp_listen, root_mail_recipient => $root_mail_recipient, use_amavisd => $use_amavisd, use_dovecot_lda => $use_dovecot_lda, @@ -79,4 +86,8 @@ class postfix ( if $satellite { include ::postfix::satellite } + + it $mailman { + include ::postfix::mailman + } } diff --git a/manifests/mailman.pp b/manifests/mailman.pp index c3eb7e8a1d22320984f9fa8173947c9037266dba..fc5f900eded579bc0c9106453ada035d1fcf8ff7 100644 --- a/manifests/mailman.pp +++ b/manifests/mailman.pp @@ -1,22 +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 => true, +# } # } # +# /!\ Do not include this class directly anymore, +# use mailman => true in the postfix top class! class postfix::mailman { - $postfix_smtp_listen = '0.0.0.0' - include postfix postfix::config { 'virtual_alias_maps': diff --git a/spec/classes/postfix_mailman_spec.rb b/spec/classes/postfix_mailman_spec.rb new file mode 100644 index 0000000000000000000000000000000000000000..15217b46cd87fb8e03ec9257a68c374222a3b6ad --- /dev/null +++ b/spec/classes/postfix_mailman_spec.rb @@ -0,0 +1,4 @@ +require 'spec_helper' + +describe 'postfix::mailman' do +end