From ccb7492f8b5dd63bf683583e6a2d84a0a5fb0617 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 16 Feb 2012 17:00:59 +0100 Subject: add disable class --- manifests/disable.pp | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 manifests/disable.pp (limited to 'manifests') diff --git a/manifests/disable.pp b/manifests/disable.pp new file mode 100644 index 0000000..fde3984 --- /dev/null +++ b/manifests/disable.pp @@ -0,0 +1,12 @@ +class postfix::disable { + + service{'postfix': + ensure => stopped, + enable => false, + } + package{'postfix': + ensure => removed, + require => Service['postfix'], + } + +} -- cgit v1.2.3 From 04e63d3abcdf608dc3efd8a9a20bb35d46bf46c5 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 16 Feb 2012 18:05:56 +0100 Subject: setting package correctly to absent --- manifests/disable.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests') diff --git a/manifests/disable.pp b/manifests/disable.pp index fde3984..f41e03c 100644 --- a/manifests/disable.pp +++ b/manifests/disable.pp @@ -5,7 +5,7 @@ class postfix::disable { enable => false, } package{'postfix': - ensure => removed, + ensure => absent, require => Service['postfix'], } -- cgit v1.2.3 From 39f1218960348d43bd368bff546d9467a1264e0d Mon Sep 17 00:00:00 2001 From: mh Date: Mon, 20 May 2013 18:54:13 +0200 Subject: debian's service provider has some issues if the script is absent, we can workaround this problem using the trick of this patch --- manifests/disable.pp | 13 ++++--------- manifests/disable/base.pp | 12 ++++++++++++ manifests/disable/debian.pp | 7 +++++++ 3 files changed, 23 insertions(+), 9 deletions(-) create mode 100644 manifests/disable/base.pp create mode 100644 manifests/disable/debian.pp (limited to 'manifests') diff --git a/manifests/disable.pp b/manifests/disable.pp index f41e03c..c233ec6 100644 --- a/manifests/disable.pp +++ b/manifests/disable.pp @@ -1,12 +1,7 @@ +# remove postfix class postfix::disable { - - service{'postfix': - ensure => stopped, - enable => false, + case $::operatingsystem { + debian: { include postfix::disable::debian } + default: { include postfix::disable::base } } - package{'postfix': - ensure => absent, - require => Service['postfix'], - } - } diff --git a/manifests/disable/base.pp b/manifests/disable/base.pp new file mode 100644 index 0000000..5c56c70 --- /dev/null +++ b/manifests/disable/base.pp @@ -0,0 +1,12 @@ +class postfix::disable::base { + + service{'postfix': + ensure => stopped, + enable => false, + } + package{'postfix': + ensure => absent, + require => Service['postfix'], + } + +} diff --git a/manifests/disable/debian.pp b/manifests/disable/debian.pp new file mode 100644 index 0000000..dc48578 --- /dev/null +++ b/manifests/disable/debian.pp @@ -0,0 +1,7 @@ +# debian has some issues with absent +# init scripts +class postfix::disable::debian inherits postfix::disable::base { + Service['postfix']{ + hasstatus => false, + } +} -- cgit v1.2.3 From a9ec67ca025197e9e85b6d6752f76ff8cac37f92 Mon Sep 17 00:00:00 2001 From: Gabriel Filion Date: Mon, 20 May 2013 16:21:06 -0400 Subject: mention the url to the issue about the services' init script this way we can follow up on the situation, put pressure on the community to get this fixed, and remove our hack when it's fixed. --- manifests/disable/debian.pp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'manifests') diff --git a/manifests/disable/debian.pp b/manifests/disable/debian.pp index dc48578..213efc5 100644 --- a/manifests/disable/debian.pp +++ b/manifests/disable/debian.pp @@ -1,5 +1,9 @@ # debian has some issues with absent -# init scripts +# init scripts. +# It's a bug in debian's provider that should be fixed in puppet, but in the +# meantime we need this hack. +# +# see: https://projects.puppetlabs.com/issues/9381 class postfix::disable::debian inherits postfix::disable::base { Service['postfix']{ hasstatus => false, -- cgit v1.2.3 From f9068edca5cd1dfd4348a9285df447a293d287fd Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 9 Jul 2014 23:14:42 +0200 Subject: get rid off lsb facts --- manifests/init.pp | 4 +- templates/master.cf.debian-6.erb | 126 +++++++++++++++++++++++++++ templates/master.cf.debian-7.erb | 157 ++++++++++++++++++++++++++++++++++ templates/master.cf.debian-lenny.erb | 126 --------------------------- templates/master.cf.debian-wheezy.erb | 157 ---------------------------------- 5 files changed, 285 insertions(+), 285 deletions(-) create mode 100644 templates/master.cf.debian-6.erb create mode 100644 templates/master.cf.debian-7.erb delete mode 100644 templates/master.cf.debian-lenny.erb delete mode 100644 templates/master.cf.debian-wheezy.erb (limited to 'manifests') diff --git a/manifests/init.pp b/manifests/init.pp index c7b9ce8..3d51bb1 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -59,7 +59,7 @@ class postfix( case $::operatingsystem { RedHat, CentOS: { - case $::lsbmajdistrelease { + case $::operatingsystemmajrelease { "4": { $postfix_seltype = "etc_t" } "5": { $postfix_seltype = "postfix_etc_t" } default: { $postfix_seltype = undef } @@ -143,7 +143,7 @@ class postfix( content => $::operatingsystem ? { Redhat => template("postfix/master.cf.redhat5.erb"), CentOS => template("postfix/master.cf.redhat5.erb"), - Debian => template("postfix/master.cf.debian-${::lsbdistcodename}.erb"), + Debian => template("postfix/master.cf.debian-${::operatingsystemmajrelease}.erb"), Ubuntu => template("postfix/master.cf.debian-etch.erb"), }, seltype => $postfix_seltype, diff --git a/templates/master.cf.debian-6.erb b/templates/master.cf.debian-6.erb new file mode 100644 index 0000000..50241b8 --- /dev/null +++ b/templates/master.cf.debian-6.erb @@ -0,0 +1,126 @@ +# file managed by puppet +# +# Postfix master process configuration file. For details on the format +# of the file, see the master(5) manual page (command: "man 5 master"). +# +# Do not forget to execute "postfix reload" after editing this file. +# +# ========================================================================== +# service type private unpriv chroot wakeup maxproc command + args +# (yes) (yes) (yes) (never) (100) +# ========================================================================== +<% if smtp_listen == 'all' %>smtp inet n - - - - smtpd +<% else %><%= smtp_listen %>:smtp inet n - - - - smtpd<% end %> +<% if use_submission == 'yes' %>submission inet n - - - - smtpd + -o smtpd_tls_security_level=encrypt + -o smtpd_sasl_auth_enable=yes + -o smtpd_client_restrictions=permit_sasl_authenticated,reject + -o milter_macro_daemon_name=ORIGINATING +<% end %> +<% if use_smtps == 'yes' %>smtps inet n - - - - smtpd + -o smtpd_tls_wrappermode=yes + -o smtpd_sasl_auth_enable=yes + -o smtpd_client_restrictions=permit_sasl_authenticated,reject + -o milter_macro_daemon_name=ORIGINATING +<% end %> +#628 inet n - - - - qmqpd +pickup fifo n - - 60 1 pickup +cleanup unix n - - - 0 cleanup +qmgr fifo n - n 300 1 qmgr +#qmgr fifo n - - 300 1 oqmgr +tlsmgr unix - - - 1000? 1 tlsmgr +rewrite unix - - - - - trivial-rewrite +bounce unix - - - - 0 bounce +defer unix - - - - 0 bounce +trace unix - - - - 0 bounce +verify unix - - - - 1 verify +flush unix n - - 1000? 0 flush +proxymap unix - - n - - proxymap +proxywrite unix - - n - 1 proxymap +smtp unix - - - - - smtp +# When relaying mail as backup MX, disable fallback_relay to avoid MX loops +relay unix - - - - - smtp + -o smtp_fallback_relay= +# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5 +showq unix n - - - - showq +error unix - - - - - error +retry unix - - - - - error +discard unix - - - - - discard +local unix - n n - - local +virtual unix - n n - - virtual +lmtp unix - - - - - lmtp +anvil unix - - - - 1 anvil +scache unix - - - - 1 scache +# +# ==================================================================== +# Interfaces to non-Postfix software. Be sure to examine the manual +# pages of the non-Postfix software to find out what options it wants. +# +# Many of the following services use the Postfix pipe(8) delivery +# agent. See the pipe(8) man page for information about ${recipient} +# and other message envelope options. +# ==================================================================== +# +# maildrop. See the Postfix MAILDROP_README file for details. +# Also specify in main.cf: maildrop_destination_recipient_limit=1 +# +maildrop unix - n n - - pipe + flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient} +# +# See the Postfix UUCP_README file for configuration details. +# +uucp unix - n n - - pipe + flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient) +# +# Other external delivery methods. +# +ifmail unix - n n - - pipe + flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient) +bsmtp unix - n n - - pipe + flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient +scalemail-backend unix - n n - 2 pipe + flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension} +mailman unix - n n - - pipe + flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py + ${nexthop} ${user} +<% if use_amavisd == 'yes' %> +amavis unix - - - - 2 smtp + -o smtp_data_done_timeout=1200 + -o smtp_send_xforward_command=yes + +127.0.0.1:10025 inet n - - - - smtpd + -o content_filter= + -o local_recipient_maps= + -o relay_recipient_maps= + -o smtpd_restriction_classes= + -o smtpd_client_restrictions= + -o smtpd_helo_restrictions= + -o smtpd_sender_restrictions= + -o smtpd_recipient_restrictions=permit_mynetworks,reject + -o mynetworks=127.0.0.0/8 + -o strict_rfc821_envelopes=yes + -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks + -o smtpd_bind_address=127.0.0.1 +<% end %> +<% if use_dovecot_lda == 'yes' %> +dovecot unix - n n - - pipe + flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop} -n -m ${extension} +<% end %> +<% if use_schleuder == 'yes' %> +schleuder unix - n n - - pipe + flags=DRhu user=schleuder argv=/usr/bin/schleuder ${user} +<% end %> +<% if use_sympa == 'yes' %> +sympa unix - n n - - pipe + flags=R user=sympa argv=/usr/lib/sympa/bin/queue ${recipient} +sympabounce unix - n n - - pipe + flags=R user=sympa argv=/usr/lib/sympa/bin/bouncequeue ${user} +<% end %> +<% if use_mlmmj == 'yes' %> +mlmmj unix - n n - - pipe + flags=DORhu user=mlmmj argv=/usr/bin/mlmmj-recieve -F -L /var/spool/mlmmj/$nexthop/ +<%- end -%> + +<%- unless mastercf_tail.to_s.empty? then -%> +<%= mastercf_tail %> +<%- end -%> diff --git a/templates/master.cf.debian-7.erb b/templates/master.cf.debian-7.erb new file mode 100644 index 0000000..cc4bbf0 --- /dev/null +++ b/templates/master.cf.debian-7.erb @@ -0,0 +1,157 @@ +# +# Postfix master process configuration file. For details on the format +# of the file, see the master(5) manual page (command: "man 5 master"). +# +# Do not forget to execute "postfix reload" after editing this file. +# +# ========================================================================== +# service type private unpriv chroot wakeup maxproc command + args +# (yes) (yes) (yes) (never) (100) +# ========================================================================== +<% if smtp_listen == 'all' %>smtp inet n - - - - smtpd +<% else %><%= smtp_listen %>:smtp inet n - - - - smtpd<% end %> +#smtp inet n - - - 1 postscreen +#smtpd pass - - - - - smtpd +#dnsblog unix - - - - 0 dnsblog +#tlsproxy unix - - - - 0 tlsproxy +<% if use_submission == 'yes' %>submission inet n - - - - smtpd + -o smtpd_tls_security_level=encrypt + -o smtpd_sasl_auth_enable=yes + -o smtpd_client_restrictions=permit_sasl_authenticated,reject + -o milter_macro_daemon_name=ORIGINATING +<% end %> +<% if use_smtps == 'yes' %>smtps inet n - - - - smtpd + -o smtpd_tls_wrappermode=yes + -o smtpd_sasl_auth_enable=yes + -o smtpd_client_restrictions=permit_sasl_authenticated,reject + -o milter_macro_daemon_name=ORIGINATING +<% end %> +#628 inet n - - - - qmqpd +pickup fifo n - - 60 1 pickup +cleanup unix n - - - 0 cleanup +qmgr fifo n - n 300 1 qmgr +#qmgr fifo n - - 300 1 oqmgr +tlsmgr unix - - - 1000? 1 tlsmgr +rewrite unix - - - - - trivial-rewrite +bounce unix - - - - 0 bounce +defer unix - - - - 0 bounce +trace unix - - - - 0 bounce +verify unix - - - - 1 verify +flush unix n - - 1000? 0 flush +proxymap unix - - n - - proxymap +proxywrite unix - - n - 1 proxymap +smtp unix - - - - - smtp +# When relaying mail as backup MX, disable fallback_relay to avoid MX loops +relay unix - - - - - smtp + -o smtp_fallback_relay= +# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5 +showq unix n - - - - showq +error unix - - - - - error +retry unix - - - - - error +discard unix - - - - - discard +local unix - n n - - local +virtual unix - n n - - virtual +lmtp unix - - - - - lmtp +anvil unix - - - - 1 anvil +scache unix - - - - 1 scache +# +# ==================================================================== +# Interfaces to non-Postfix software. Be sure to examine the manual +# pages of the non-Postfix software to find out what options it wants. +# +# Many of the following services use the Postfix pipe(8) delivery +# agent. See the pipe(8) man page for information about ${recipient} +# and other message envelope options. +# ==================================================================== +# +# maildrop. See the Postfix MAILDROP_README file for details. +# Also specify in main.cf: maildrop_destination_recipient_limit=1 +# +maildrop unix - n n - - pipe + flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient} +# +# ==================================================================== +# +# Recent Cyrus versions can use the existing "lmtp" master.cf entry. +# +# Specify in cyrus.conf: +# lmtp cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4 +# +# Specify in main.cf one or more of the following: +# mailbox_transport = lmtp:inet:localhost +# virtual_transport = lmtp:inet:localhost +# +# ==================================================================== +# +# Cyrus 2.1.5 (Amos Gouaux) +# Also specify in main.cf: cyrus_destination_recipient_limit=1 +# +#cyrus unix - n n - - pipe +# user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user} +# +# ==================================================================== +# Old example of delivery via Cyrus. +# +#old-cyrus unix - n n - - pipe +# flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user} +# +# ==================================================================== +# +# See the Postfix UUCP_README file for configuration details. +# +uucp unix - n n - - pipe + flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient) +# +# Other external delivery methods. +# +ifmail unix - n n - - pipe + flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient) +bsmtp unix - n n - - pipe + flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient +scalemail-backend unix - n n - 2 pipe + flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension} +mailman unix - n n - - pipe + flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py + ${nexthop} ${user} + +<% if use_amavisd == 'yes' %> +amavis unix - - - - 2 smtp + -o smtp_data_done_timeout=1200 + -o smtp_send_xforward_command=yes + +127.0.0.1:10025 inet n - - - - smtpd + -o content_filter= + -o local_recipient_maps= + -o relay_recipient_maps= + -o smtpd_restriction_classes= + -o smtpd_client_restrictions= + -o smtpd_helo_restrictions= + -o smtpd_sender_restrictions= + -o smtpd_recipient_restrictions=permit_mynetworks,reject + -o mynetworks=127.0.0.0/8 + -o strict_rfc821_envelopes=yes + -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks + -o smtpd_bind_address=127.0.0.1 +<% end %> +<% if use_dovecot_lda == 'yes' %> +dovecot unix - n n - - pipe + flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop} -n -m ${extension} +<% end %> +<% if use_schleuder == 'yes' %> +schleuder unix - n n - - pipe + flags=DRhu user=schleuder argv=/usr/bin/schleuder ${user} +<% end %> +<% if use_sympa == 'yes' %> +sympa unix - n n - - pipe + flags=R user=sympa argv=/usr/lib/sympa/bin/queue ${recipient} +sympabounce unix - n n - - pipe + flags=R user=sympa argv=/usr/lib/sympa/bin/bouncequeue ${user} +<% end %> +<% if use_mlmmj == 'yes' %> +mlmmj unix - n n - - pipe + flags=DORhu user=mlmmj argv=/usr/bin/mlmmj-recieve -F -L /var/spool/mlmmj/$nexthop/ +<%- end -%> + +<%- unless mastercf_tail.to_s.empty? then -%> +<%= mastercf_tail %> +<%- end -%> diff --git a/templates/master.cf.debian-lenny.erb b/templates/master.cf.debian-lenny.erb deleted file mode 100644 index 50241b8..0000000 --- a/templates/master.cf.debian-lenny.erb +++ /dev/null @@ -1,126 +0,0 @@ -# file managed by puppet -# -# Postfix master process configuration file. For details on the format -# of the file, see the master(5) manual page (command: "man 5 master"). -# -# Do not forget to execute "postfix reload" after editing this file. -# -# ========================================================================== -# service type private unpriv chroot wakeup maxproc command + args -# (yes) (yes) (yes) (never) (100) -# ========================================================================== -<% if smtp_listen == 'all' %>smtp inet n - - - - smtpd -<% else %><%= smtp_listen %>:smtp inet n - - - - smtpd<% end %> -<% if use_submission == 'yes' %>submission inet n - - - - smtpd - -o smtpd_tls_security_level=encrypt - -o smtpd_sasl_auth_enable=yes - -o smtpd_client_restrictions=permit_sasl_authenticated,reject - -o milter_macro_daemon_name=ORIGINATING -<% end %> -<% if use_smtps == 'yes' %>smtps inet n - - - - smtpd - -o smtpd_tls_wrappermode=yes - -o smtpd_sasl_auth_enable=yes - -o smtpd_client_restrictions=permit_sasl_authenticated,reject - -o milter_macro_daemon_name=ORIGINATING -<% end %> -#628 inet n - - - - qmqpd -pickup fifo n - - 60 1 pickup -cleanup unix n - - - 0 cleanup -qmgr fifo n - n 300 1 qmgr -#qmgr fifo n - - 300 1 oqmgr -tlsmgr unix - - - 1000? 1 tlsmgr -rewrite unix - - - - - trivial-rewrite -bounce unix - - - - 0 bounce -defer unix - - - - 0 bounce -trace unix - - - - 0 bounce -verify unix - - - - 1 verify -flush unix n - - 1000? 0 flush -proxymap unix - - n - - proxymap -proxywrite unix - - n - 1 proxymap -smtp unix - - - - - smtp -# When relaying mail as backup MX, disable fallback_relay to avoid MX loops -relay unix - - - - - smtp - -o smtp_fallback_relay= -# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5 -showq unix n - - - - showq -error unix - - - - - error -retry unix - - - - - error -discard unix - - - - - discard -local unix - n n - - local -virtual unix - n n - - virtual -lmtp unix - - - - - lmtp -anvil unix - - - - 1 anvil -scache unix - - - - 1 scache -# -# ==================================================================== -# Interfaces to non-Postfix software. Be sure to examine the manual -# pages of the non-Postfix software to find out what options it wants. -# -# Many of the following services use the Postfix pipe(8) delivery -# agent. See the pipe(8) man page for information about ${recipient} -# and other message envelope options. -# ==================================================================== -# -# maildrop. See the Postfix MAILDROP_README file for details. -# Also specify in main.cf: maildrop_destination_recipient_limit=1 -# -maildrop unix - n n - - pipe - flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient} -# -# See the Postfix UUCP_README file for configuration details. -# -uucp unix - n n - - pipe - flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient) -# -# Other external delivery methods. -# -ifmail unix - n n - - pipe - flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient) -bsmtp unix - n n - - pipe - flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient -scalemail-backend unix - n n - 2 pipe - flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension} -mailman unix - n n - - pipe - flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py - ${nexthop} ${user} -<% if use_amavisd == 'yes' %> -amavis unix - - - - 2 smtp - -o smtp_data_done_timeout=1200 - -o smtp_send_xforward_command=yes - -127.0.0.1:10025 inet n - - - - smtpd - -o content_filter= - -o local_recipient_maps= - -o relay_recipient_maps= - -o smtpd_restriction_classes= - -o smtpd_client_restrictions= - -o smtpd_helo_restrictions= - -o smtpd_sender_restrictions= - -o smtpd_recipient_restrictions=permit_mynetworks,reject - -o mynetworks=127.0.0.0/8 - -o strict_rfc821_envelopes=yes - -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks - -o smtpd_bind_address=127.0.0.1 -<% end %> -<% if use_dovecot_lda == 'yes' %> -dovecot unix - n n - - pipe - flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop} -n -m ${extension} -<% end %> -<% if use_schleuder == 'yes' %> -schleuder unix - n n - - pipe - flags=DRhu user=schleuder argv=/usr/bin/schleuder ${user} -<% end %> -<% if use_sympa == 'yes' %> -sympa unix - n n - - pipe - flags=R user=sympa argv=/usr/lib/sympa/bin/queue ${recipient} -sympabounce unix - n n - - pipe - flags=R user=sympa argv=/usr/lib/sympa/bin/bouncequeue ${user} -<% end %> -<% if use_mlmmj == 'yes' %> -mlmmj unix - n n - - pipe - flags=DORhu user=mlmmj argv=/usr/bin/mlmmj-recieve -F -L /var/spool/mlmmj/$nexthop/ -<%- end -%> - -<%- unless mastercf_tail.to_s.empty? then -%> -<%= mastercf_tail %> -<%- end -%> diff --git a/templates/master.cf.debian-wheezy.erb b/templates/master.cf.debian-wheezy.erb deleted file mode 100644 index cc4bbf0..0000000 --- a/templates/master.cf.debian-wheezy.erb +++ /dev/null @@ -1,157 +0,0 @@ -# -# Postfix master process configuration file. For details on the format -# of the file, see the master(5) manual page (command: "man 5 master"). -# -# Do not forget to execute "postfix reload" after editing this file. -# -# ========================================================================== -# service type private unpriv chroot wakeup maxproc command + args -# (yes) (yes) (yes) (never) (100) -# ========================================================================== -<% if smtp_listen == 'all' %>smtp inet n - - - - smtpd -<% else %><%= smtp_listen %>:smtp inet n - - - - smtpd<% end %> -#smtp inet n - - - 1 postscreen -#smtpd pass - - - - - smtpd -#dnsblog unix - - - - 0 dnsblog -#tlsproxy unix - - - - 0 tlsproxy -<% if use_submission == 'yes' %>submission inet n - - - - smtpd - -o smtpd_tls_security_level=encrypt - -o smtpd_sasl_auth_enable=yes - -o smtpd_client_restrictions=permit_sasl_authenticated,reject - -o milter_macro_daemon_name=ORIGINATING -<% end %> -<% if use_smtps == 'yes' %>smtps inet n - - - - smtpd - -o smtpd_tls_wrappermode=yes - -o smtpd_sasl_auth_enable=yes - -o smtpd_client_restrictions=permit_sasl_authenticated,reject - -o milter_macro_daemon_name=ORIGINATING -<% end %> -#628 inet n - - - - qmqpd -pickup fifo n - - 60 1 pickup -cleanup unix n - - - 0 cleanup -qmgr fifo n - n 300 1 qmgr -#qmgr fifo n - - 300 1 oqmgr -tlsmgr unix - - - 1000? 1 tlsmgr -rewrite unix - - - - - trivial-rewrite -bounce unix - - - - 0 bounce -defer unix - - - - 0 bounce -trace unix - - - - 0 bounce -verify unix - - - - 1 verify -flush unix n - - 1000? 0 flush -proxymap unix - - n - - proxymap -proxywrite unix - - n - 1 proxymap -smtp unix - - - - - smtp -# When relaying mail as backup MX, disable fallback_relay to avoid MX loops -relay unix - - - - - smtp - -o smtp_fallback_relay= -# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5 -showq unix n - - - - showq -error unix - - - - - error -retry unix - - - - - error -discard unix - - - - - discard -local unix - n n - - local -virtual unix - n n - - virtual -lmtp unix - - - - - lmtp -anvil unix - - - - 1 anvil -scache unix - - - - 1 scache -# -# ==================================================================== -# Interfaces to non-Postfix software. Be sure to examine the manual -# pages of the non-Postfix software to find out what options it wants. -# -# Many of the following services use the Postfix pipe(8) delivery -# agent. See the pipe(8) man page for information about ${recipient} -# and other message envelope options. -# ==================================================================== -# -# maildrop. See the Postfix MAILDROP_README file for details. -# Also specify in main.cf: maildrop_destination_recipient_limit=1 -# -maildrop unix - n n - - pipe - flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient} -# -# ==================================================================== -# -# Recent Cyrus versions can use the existing "lmtp" master.cf entry. -# -# Specify in cyrus.conf: -# lmtp cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4 -# -# Specify in main.cf one or more of the following: -# mailbox_transport = lmtp:inet:localhost -# virtual_transport = lmtp:inet:localhost -# -# ==================================================================== -# -# Cyrus 2.1.5 (Amos Gouaux) -# Also specify in main.cf: cyrus_destination_recipient_limit=1 -# -#cyrus unix - n n - - pipe -# user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user} -# -# ==================================================================== -# Old example of delivery via Cyrus. -# -#old-cyrus unix - n n - - pipe -# flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user} -# -# ==================================================================== -# -# See the Postfix UUCP_README file for configuration details. -# -uucp unix - n n - - pipe - flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient) -# -# Other external delivery methods. -# -ifmail unix - n n - - pipe - flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient) -bsmtp unix - n n - - pipe - flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient -scalemail-backend unix - n n - 2 pipe - flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension} -mailman unix - n n - - pipe - flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py - ${nexthop} ${user} - -<% if use_amavisd == 'yes' %> -amavis unix - - - - 2 smtp - -o smtp_data_done_timeout=1200 - -o smtp_send_xforward_command=yes - -127.0.0.1:10025 inet n - - - - smtpd - -o content_filter= - -o local_recipient_maps= - -o relay_recipient_maps= - -o smtpd_restriction_classes= - -o smtpd_client_restrictions= - -o smtpd_helo_restrictions= - -o smtpd_sender_restrictions= - -o smtpd_recipient_restrictions=permit_mynetworks,reject - -o mynetworks=127.0.0.0/8 - -o strict_rfc821_envelopes=yes - -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks - -o smtpd_bind_address=127.0.0.1 -<% end %> -<% if use_dovecot_lda == 'yes' %> -dovecot unix - n n - - pipe - flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop} -n -m ${extension} -<% end %> -<% if use_schleuder == 'yes' %> -schleuder unix - n n - - pipe - flags=DRhu user=schleuder argv=/usr/bin/schleuder ${user} -<% end %> -<% if use_sympa == 'yes' %> -sympa unix - n n - - pipe - flags=R user=sympa argv=/usr/lib/sympa/bin/queue ${recipient} -sympabounce unix - n n - - pipe - flags=R user=sympa argv=/usr/lib/sympa/bin/bouncequeue ${user} -<% end %> -<% if use_mlmmj == 'yes' %> -mlmmj unix - n n - - pipe - flags=DORhu user=mlmmj argv=/usr/bin/mlmmj-recieve -F -L /var/spool/mlmmj/$nexthop/ -<%- end -%> - -<%- unless mastercf_tail.to_s.empty? then -%> -<%= mastercf_tail %> -<%- end -%> -- cgit v1.2.3 From 6e051c3b8567c78ce029b1fac514dbd6975effa0 Mon Sep 17 00:00:00 2001 From: Jerome Charaoui Date: Fri, 20 Feb 2015 17:06:47 -0500 Subject: convert to file resources to stdlib's file_line --- manifests/transport.pp | 4 ++-- manifests/virtual.pp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'manifests') diff --git a/manifests/transport.pp b/manifests/transport.pp index 90c5468..bab9574 100644 --- a/manifests/transport.pp +++ b/manifests/transport.pp @@ -34,9 +34,9 @@ Example usage: */ define postfix::transport ($ensure="present", $destination) { - line {"${name} ${destination}": + file_line {"${name} ${destination}": ensure => $ensure, - file => "/etc/postfix/transport", + path => "/etc/postfix/transport", line => "${name} ${destination}", notify => Exec["generate /etc/postfix/transport.db"], require => Package["postfix"], diff --git a/manifests/virtual.pp b/manifests/virtual.pp index d6912a4..4a434d2 100644 --- a/manifests/virtual.pp +++ b/manifests/virtual.pp @@ -34,9 +34,9 @@ Example usage: */ define postfix::virtual ($ensure="present", $destination) { - line {"${name} ${destination}": + file_line {"${name} ${destination}": ensure => $ensure, - file => "/etc/postfix/virtual", + path => "/etc/postfix/virtual", line => "${name} ${destination}", notify => Exec["generate /etc/postfix/virtual.db"], require => Package["postfix"], -- cgit v1.2.3 From 538debac1f0410a6bb84827e13a3ce393eedcded Mon Sep 17 00:00:00 2001 From: Jerome Charaoui Date: Fri, 20 Feb 2015 17:16:08 -0500 Subject: fix module dependency comment in transport and virtual --- manifests/transport.pp | 2 +- manifests/virtual.pp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'manifests') diff --git a/manifests/transport.pp b/manifests/transport.pp index bab9574..08b93e5 100644 --- a/manifests/transport.pp +++ b/manifests/transport.pp @@ -12,7 +12,7 @@ Requires: - Class["postfix"] - Postfix::Hash["/etc/postfix/transport"] - Postfix::Config["transport_maps"] -- common::line (from module common) +- file_line (from module stdlib) Example usage: diff --git a/manifests/virtual.pp b/manifests/virtual.pp index 4a434d2..06df32a 100644 --- a/manifests/virtual.pp +++ b/manifests/virtual.pp @@ -12,7 +12,7 @@ Requires: - Class["postfix"] - Postfix::Hash["/etc/postfix/virtual"] - Postfix::Config["virtual_alias_maps"] -- common::line (from module common) +- file_line (from module stdlib) Example usage: -- cgit v1.2.3 From a61349e001b807f23eea3e4d7d97cd9c83fcd6f9 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sat, 28 Feb 2015 12:08:10 +0000 Subject: Fix usage of the common::module_dir. --- manifests/init.pp | 2 +- manifests/tlspolicy.pp | 2 +- manifests/transport_regexp.pp | 2 +- manifests/virtual_regexp.pp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'manifests') diff --git a/manifests/init.pp b/manifests/init.pp index 3d51bb1..f454be9 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -74,7 +74,7 @@ class postfix( # Bootstrap moduledir include common::moduledir - module_dir{'postfix': } + common::module_dir{'postfix': } # Include optional classes if $anon_sasl == 'yes' { diff --git a/manifests/tlspolicy.pp b/manifests/tlspolicy.pp index e1272b9..d901710 100644 --- a/manifests/tlspolicy.pp +++ b/manifests/tlspolicy.pp @@ -16,7 +16,7 @@ class postfix::tlspolicy( ) { include common::moduledir - module_dir{'postfix/tls_policy': } + common::module_dir{'postfix/tls_policy': } $postfix_tlspolicy_dir = "${common::moduledir::module_dir_path}/postfix/tls_policy" $postfix_merged_tlspolicy = "${postfix_tlspolicy_dir}/merged_tls_policy" diff --git a/manifests/transport_regexp.pp b/manifests/transport_regexp.pp index eaa78da..4961141 100644 --- a/manifests/transport_regexp.pp +++ b/manifests/transport_regexp.pp @@ -22,7 +22,7 @@ class postfix::transport_regexp { include common::moduledir - module_dir{'postfix/transport_regexp': } + common::module_dir{'postfix/transport_regexp': } $postfix_transport_regexp_dir = "${common::moduledir::module_dir_path}/postfix/transport_regexp" $postfix_transport_regexp_snippets_dir = "${postfix_transport_regexp_dir}/transport_regexp.d" diff --git a/manifests/virtual_regexp.pp b/manifests/virtual_regexp.pp index af68ec6..18bbd8c 100644 --- a/manifests/virtual_regexp.pp +++ b/manifests/virtual_regexp.pp @@ -22,7 +22,7 @@ class postfix::virtual_regexp { include common::moduledir - module_dir{'postfix/virtual_regexp': } + common::module_dir{'postfix/virtual_regexp': } $postfix_virtual_regexp_dir = "${common::moduledir::module_dir_path}/postfix/virtual_regexp" $postfix_virtual_regexp_snippets_dir = "${postfix_virtual_regexp_dir}/virtual_regexp.d" -- cgit v1.2.3 From 49f1024e1673c50c728d51a542c82b7a7cc4505b Mon Sep 17 00:00:00 2001 From: varac Date: Tue, 22 Jan 2013 22:26:01 +0100 Subject: added smtp_auth.pp --- manifests/smtp_auth.pp | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 manifests/smtp_auth.pp (limited to 'manifests') diff --git a/manifests/smtp_auth.pp b/manifests/smtp_auth.pp new file mode 100644 index 0000000..191f234 --- /dev/null +++ b/manifests/smtp_auth.pp @@ -0,0 +1,41 @@ +/* +== Definition: postfix::smtp_auth + +Manages content of the /etc/postfix/smtp_auth map. + +Requires: +- Class["postfix"] +- Postfix::Hash["/etc/postfix/smtp_auth"] +- common::line (from module common) + +Example usage: + + node "toto.example.com" { + + include postfix + + postfix::hash { "/etc/postfix/smtp_auth": + ensure => present, + } + postfix::config { "smpt_auth_maps": + value => "hash:/etc/postfix/smtp_auth" + } + postfix::smtp_auth { "gmail.com": + ensure => present, + user => "USER", + password => "PW", + } + } +*/ + + +define postfix::smtp_auth ($ensure="present", $user, $password) { + line {"${name}": + ensure => $ensure, + file => "/etc/postfix/smtp_auth", + line => "${name} ${user}:${password}", + notify => Exec["generate /etc/postfix/smtp_auth.db"], + require => Package["postfix"], + } + +} -- cgit v1.2.3 From 316dedeb142e05f75200f32636c11659f060626e Mon Sep 17 00:00:00 2001 From: varac Date: Wed, 4 Mar 2015 09:24:55 +0100 Subject: linted smtp_auth.pp --- manifests/smtp_auth.pp | 74 ++++++++++++++++++++++++-------------------------- 1 file changed, 35 insertions(+), 39 deletions(-) (limited to 'manifests') diff --git a/manifests/smtp_auth.pp b/manifests/smtp_auth.pp index 191f234..ae6a9a5 100644 --- a/manifests/smtp_auth.pp +++ b/manifests/smtp_auth.pp @@ -1,41 +1,37 @@ -/* -== Definition: postfix::smtp_auth - -Manages content of the /etc/postfix/smtp_auth map. - -Requires: -- Class["postfix"] -- Postfix::Hash["/etc/postfix/smtp_auth"] -- common::line (from module common) - -Example usage: - - node "toto.example.com" { - - include postfix - - postfix::hash { "/etc/postfix/smtp_auth": - ensure => present, - } - postfix::config { "smpt_auth_maps": - value => "hash:/etc/postfix/smtp_auth" - } - postfix::smtp_auth { "gmail.com": - ensure => present, - user => "USER", - password => "PW", - } +# == Definition: postfix::smtp_auth +# +# Manages content of the /etc/postfix/smtp_auth map. +# +# Requires: +# - Class["postfix"] +# - Postfix::Hash["/etc/postfix/smtp_auth"] +# - common::line (from module common) +# +# Example usage: +# +# node 'toto.example.com' { +# +# include postfix +# +# postfix::hash { '/etc/postfix/smtp_auth': +# ensure => present, +# } +# postfix::config { 'smpt_auth_maps': +# value => 'hash:/etc/postfix/smtp_auth' +# } +# postfix::smtp_auth { 'gmail.com': +# ensure => present, +# user => 'USER', +# password => 'PW', +# } +# } + +define postfix::smtp_auth ($user, $password, $ensure=present) { + line { $name: + ensure => $ensure, + file => '/etc/postfix/smtp_auth', + line => "${name} ${user}:${password}", + notify => Exec['generate /etc/postfix/smtp_auth.db'], + require => Package['postfix'], } -*/ - - -define postfix::smtp_auth ($ensure="present", $user, $password) { - line {"${name}": - ensure => $ensure, - file => "/etc/postfix/smtp_auth", - line => "${name} ${user}:${password}", - notify => Exec["generate /etc/postfix/smtp_auth.db"], - require => Package["postfix"], - } - } -- cgit v1.2.3 From 06a63a98fc975d53dfe11e1d15ddd6c7f5607cbc Mon Sep 17 00:00:00 2001 From: varac Date: Thu, 5 Mar 2015 09:09:00 +0100 Subject: use stdlib file_line instead of deprecated line from common module --- manifests/smtp_auth.pp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'manifests') diff --git a/manifests/smtp_auth.pp b/manifests/smtp_auth.pp index ae6a9a5..845a38b 100644 --- a/manifests/smtp_auth.pp +++ b/manifests/smtp_auth.pp @@ -27,11 +27,11 @@ # } define postfix::smtp_auth ($user, $password, $ensure=present) { - line { $name: - ensure => $ensure, - file => '/etc/postfix/smtp_auth', - line => "${name} ${user}:${password}", - notify => Exec['generate /etc/postfix/smtp_auth.db'], - require => Package['postfix'], - } + file_line { $name: + ensure => $ensure, + path => '/etc/postfix/smtp_auth', + line => "${name} ${user}:${password}", + notify => Exec['generate /etc/postfix/smtp_auth.db'], + require => Package['postfix'], + } } -- cgit v1.2.3 From 5d25ec9d1ec77d735d393ef7cab7d1232e3d8997 Mon Sep 17 00:00:00 2001 From: varac Date: Thu, 5 Mar 2015 09:23:05 +0100 Subject: fix postfix::satellite class MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit i got this error using postfix::satellite: Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Cannot reassign variable valid_fqdn at /etc/puppet/modules/postfix/manifests/satellite.pp:32 … reassigning a variable within a given scope doesn't work in puppet see https://docs.puppetlabs.com/puppet/latest/reference/lang_variables.html#no-reassignment i still think overriding $::fqdn is not a good idea, but for now, i just want to get this class working again. --- manifests/satellite.pp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'manifests') diff --git a/manifests/satellite.pp b/manifests/satellite.pp index 739c625..45a40ad 100644 --- a/manifests/satellite.pp +++ b/manifests/satellite.pp @@ -21,16 +21,16 @@ # } # } # + class postfix::satellite( $relayhost = '', - $valid_fqdn = '', + $valid_fqdn = $::fqdn, $root_mail_recipient = '' ) { - # If $valid_fqdn exists, use it to override $fqdn - case $valid_fqdn { - "": { $valid_fqdn = $::fqdn } - default: { $fqdn = "${valid_fqdn}" } + # If $valid_fqdn is provided, use it to override $fqdn + if $valid_fqdn != $::fdqn { + $fqdn = $valid_fqdn } class { 'postfix': -- cgit v1.2.3 From c4b0de71fe3201fa8c83b61e571a7aed690edb6c Mon Sep 17 00:00:00 2001 From: Gabriel Filion Date: Sun, 8 Mar 2015 12:46:44 -0400 Subject: fix smtp_auth requirements in comment last commit moved requirement from the common module to puppetlab's stdlib --- manifests/smtp_auth.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests') diff --git a/manifests/smtp_auth.pp b/manifests/smtp_auth.pp index 845a38b..6a13a0d 100644 --- a/manifests/smtp_auth.pp +++ b/manifests/smtp_auth.pp @@ -5,7 +5,7 @@ # Requires: # - Class["postfix"] # - Postfix::Hash["/etc/postfix/smtp_auth"] -# - common::line (from module common) +# - file_line (from puppetlab's stdlib module) # # Example usage: # -- cgit v1.2.3 From 2021023f31043e44de5bf2733bb12a66c33a6c71 Mon Sep 17 00:00:00 2001 From: Gabriel Filion Date: Sun, 8 Mar 2015 12:47:31 -0400 Subject: lint smtp_auth (spacing style) --- manifests/smtp_auth.pp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'manifests') diff --git a/manifests/smtp_auth.pp b/manifests/smtp_auth.pp index 6a13a0d..882b01d 100644 --- a/manifests/smtp_auth.pp +++ b/manifests/smtp_auth.pp @@ -28,10 +28,10 @@ define postfix::smtp_auth ($user, $password, $ensure=present) { file_line { $name: - ensure => $ensure, - path => '/etc/postfix/smtp_auth', - line => "${name} ${user}:${password}", - notify => Exec['generate /etc/postfix/smtp_auth.db'], - require => Package['postfix'], - } + ensure => $ensure, + path => '/etc/postfix/smtp_auth', + line => "${name} ${user}:${password}", + notify => Exec['generate /etc/postfix/smtp_auth.db'], + require => Package['postfix'], + } } -- cgit v1.2.3 From 3c89b7deacffa570d03282368689069f388170de Mon Sep 17 00:00:00 2001 From: Gabriel Filion Date: Wed, 11 Mar 2015 18:51:41 -0400 Subject: small typo in smtp_auth example --- manifests/smtp_auth.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests') diff --git a/manifests/smtp_auth.pp b/manifests/smtp_auth.pp index 882b01d..b553fb5 100644 --- a/manifests/smtp_auth.pp +++ b/manifests/smtp_auth.pp @@ -16,7 +16,7 @@ # postfix::hash { '/etc/postfix/smtp_auth': # ensure => present, # } -# postfix::config { 'smpt_auth_maps': +# postfix::config { 'smtp_auth_maps': # value => 'hash:/etc/postfix/smtp_auth' # } # postfix::smtp_auth { 'gmail.com': -- cgit v1.2.3 From 58c687dcaa5c24d3258b34a2a75e7a964431fd91 Mon Sep 17 00:00:00 2001 From: elijah Date: Fri, 21 Aug 2015 17:09:58 -0700 Subject: make default value for alias_maps optional --- manifests/init.pp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'manifests') diff --git a/manifests/init.pp b/manifests/init.pp index f454be9..4a7ca72 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -52,7 +52,8 @@ class postfix( $use_smtps = "no", $mastercf_tail = "", $inet_interfaces = 'all', - $myorigin = $::fqdn + $myorigin = $::fqdn, + $default_alias_maps = true ) { # selinux labels differ from one distribution to another @@ -165,9 +166,13 @@ class postfix( } # Default configuration parameters + if $default_alias_maps { + postfix::config { + "alias_maps": value => "hash:/etc/aliases"; + } + } postfix::config { - "myorigin": value => "${myorigin}"; - "alias_maps": value => "hash:/etc/aliases"; + "myorigin": value => "${myorigin}"; "inet_interfaces": value => "${inet_interfaces}"; } -- cgit v1.2.3 From 1eea47c2f6b8f0290fb27558eb873563fc99758b Mon Sep 17 00:00:00 2001 From: varac Date: Tue, 1 Dec 2015 14:44:38 +0100 Subject: linted init.pp --- manifests/init.pp | 110 +++++++++++++++++++++++++++--------------------------- 1 file changed, 56 insertions(+), 54 deletions(-) (limited to 'manifests') diff --git a/manifests/init.pp b/manifests/init.pp index 4a7ca72..54f36e5 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -34,23 +34,23 @@ # } # class postfix( - $smtp_listen = "127.0.0.1", - $root_mail_recipient = "nobody", - $anon_sasl = "no", - $manage_header_checks = "no", - $manage_tls_policy = "no", - $manage_transport_regexp = "no", - $manage_virtual_regexp = "no", + $smtp_listen = '127.0.0.1', + $root_mail_recipient = 'nobody', + $anon_sasl = 'no', + $manage_header_checks = 'no', + $manage_tls_policy = 'no', + $manage_transport_regexp = 'no', + $manage_virtual_regexp = 'no', $tls_fingerprint_digest = 'sha1', - $use_amavisd = "no", - $use_dovecot_lda = "no", - $use_schleuder = "no", - $use_sympa = "no", - $use_firma = "no", - $use_mlmmj = "no", - $use_submission = "no", - $use_smtps = "no", - $mastercf_tail = "", + $use_amavisd = 'no', + $use_dovecot_lda = 'no', + $use_schleuder = 'no', + $use_sympa = 'no', + $use_firma = 'no', + $use_mlmmj = 'no', + $use_submission = 'no', + $use_smtps = 'no', + $mastercf_tail = '', $inet_interfaces = 'all', $myorigin = $::fqdn, $default_alias_maps = true @@ -61,8 +61,8 @@ class postfix( RedHat, CentOS: { case $::operatingsystemmajrelease { - "4": { $postfix_seltype = "etc_t" } - "5": { $postfix_seltype = "postfix_etc_t" } + '4': { $postfix_seltype = 'etc_t' } + '5': { $postfix_seltype = 'postfix_etc_t' } default: { $postfix_seltype = undef } } } @@ -81,7 +81,8 @@ class postfix( if $anon_sasl == 'yes' { include postfix::anonsasl } - if $header_checks == 'yes' { + # this global variable needs to get parameterized as well + if $::header_checks == 'yes' { include postfix::header_checks } if $manage_tls_policy == 'yes' { @@ -99,7 +100,7 @@ class postfix( include postfix::virtual_regexp } - package { ["postfix", "mailx"]: + package { ['postfix', 'mailx']: ensure => installed } @@ -107,86 +108,87 @@ class postfix( Package[mailx] { name => 'bsd-mailx' } } - service { "postfix": + service { 'postfix': ensure => running, - require => Package["postfix"], + require => Package['postfix'], } - file { "/etc/mailname": + file { '/etc/mailname': ensure => present, - content => "${fqdn}\n", + content => "${::fqdn}\n", seltype => $postfix_seltype, } # Aliases - file { "/etc/aliases": - ensure => present, + file { '/etc/aliases': + ensure => present, content => "# file managed by puppet\n", replace => false, seltype => $postfix_seltype, - notify => Exec["newaliases"], + notify => Exec['newaliases'], } # Aliases - exec { "newaliases": - command => "/usr/bin/newaliases", + exec { 'newaliases': + command => '/usr/bin/newaliases', refreshonly => true, - require => Package["postfix"], - subscribe => File["/etc/aliases"], + require => Package['postfix'], + subscribe => File['/etc/aliases'], } # Config files - file { "/etc/postfix/master.cf": + file { '/etc/postfix/master.cf': ensure => present, - owner => "root", - group => "root", - mode => "0644", + owner => 'root', + group => 'root', + mode => '0644', content => $::operatingsystem ? { - Redhat => template("postfix/master.cf.redhat5.erb"), - CentOS => template("postfix/master.cf.redhat5.erb"), + Redhat => template('postfix/master.cf.redhat5.erb'), + CentOS => template('postfix/master.cf.redhat5.erb'), Debian => template("postfix/master.cf.debian-${::operatingsystemmajrelease}.erb"), - Ubuntu => template("postfix/master.cf.debian-etch.erb"), + Ubuntu => template('postfix/master.cf.debian-etch.erb'), }, seltype => $postfix_seltype, - notify => Service["postfix"], - require => Package["postfix"], + notify => Service['postfix'], + require => Package['postfix'], } # Config files - file { "/etc/postfix/main.cf": + file { '/etc/postfix/main.cf': ensure => present, - owner => "root", - group => "root", - mode => "0644", - source => "puppet:///modules/postfix/main.cf", + owner => 'root', + group => 'root', + mode => '0644', + source => 'puppet:///modules/postfix/main.cf', replace => false, seltype => $postfix_seltype, - notify => Service["postfix"], - require => Package["postfix"], + notify => Service['postfix'], + require => Package['postfix'], } # Default configuration parameters if $default_alias_maps { postfix::config { - "alias_maps": value => "hash:/etc/aliases"; + 'alias_maps': value => 'hash:/etc/aliases'; } } postfix::config { - "myorigin": value => "${myorigin}"; - "inet_interfaces": value => "${inet_interfaces}"; + 'myorigin': value => $myorigin; + 'inet_interfaces': value => $inet_interfaces; } case $::operatingsystem { RedHat, CentOS: { postfix::config { - "sendmail_path": value => "/usr/sbin/sendmail.postfix"; - "newaliases_path": value => "/usr/bin/newaliases.postfix"; - "mailq_path": value => "/usr/bin/mailq.postfix"; + 'sendmail_path': value => '/usr/sbin/sendmail.postfix'; + 'newaliases_path': value => '/usr/bin/newaliases.postfix'; + 'mailq_path': value => '/usr/bin/mailq.postfix'; } } + default: {} } - postfix::mailalias {"root": + postfix::mailalias {'root': recipient => $root_mail_recipient, } } -- cgit v1.2.3 From f4201357e5da4cbdecd558218c262c01d92c4697 Mon Sep 17 00:00:00 2001 From: varac Date: Tue, 1 Dec 2015 14:50:56 +0100 Subject: [refactor] Dont use case statement in resource def --- manifests/init.pp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'manifests') diff --git a/manifests/init.pp b/manifests/init.pp index 54f36e5..f92e20b 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -56,10 +56,12 @@ class postfix( $default_alias_maps = true ) { - # selinux labels differ from one distribution to another case $::operatingsystem { RedHat, CentOS: { + $master_cf_template = 'postfix/master.cf.redhat5.erb' + + # selinux labels differ from one distribution to another case $::operatingsystemmajrelease { '4': { $postfix_seltype = 'etc_t' } '5': { $postfix_seltype = 'postfix_etc_t' } @@ -67,8 +69,17 @@ class postfix( } } + 'Debian': { + $master_cf_template = "postfix/master.cf.debian-${::operatingsystemmajrelease}.erb" + } + + 'Ubuntu': { + $master_cf_template = 'postfix/master.cf.debian-sid.erb' + } + default: { - $postfix_seltype = undef + $postfix_seltype = undef + $master_cf_template = undef } } @@ -142,12 +153,7 @@ class postfix( owner => 'root', group => 'root', mode => '0644', - content => $::operatingsystem ? { - Redhat => template('postfix/master.cf.redhat5.erb'), - CentOS => template('postfix/master.cf.redhat5.erb'), - Debian => template("postfix/master.cf.debian-${::operatingsystemmajrelease}.erb"), - Ubuntu => template('postfix/master.cf.debian-etch.erb'), - }, + content => template($master_cf_template), seltype => $postfix_seltype, notify => Service['postfix'], require => Package['postfix'], -- cgit v1.2.3 From 969076a813b88dafd222c413bf6fbabab837eafb Mon Sep 17 00:00:00 2001 From: varac Date: Tue, 1 Dec 2015 16:27:41 +0100 Subject: join case statements in init.pp --- manifests/init.pp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'manifests') diff --git a/manifests/init.pp b/manifests/init.pp index f92e20b..d298183 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -58,7 +58,7 @@ class postfix( case $::operatingsystem { - RedHat, CentOS: { + 'RedHat', 'CentOS': { $master_cf_template = 'postfix/master.cf.redhat5.erb' # selinux labels differ from one distribution to another @@ -67,6 +67,12 @@ class postfix( '5': { $postfix_seltype = 'postfix_etc_t' } default: { $postfix_seltype = undef } } + + postfix::config { + 'sendmail_path': value => '/usr/sbin/sendmail.postfix'; + 'newaliases_path': value => '/usr/bin/newaliases.postfix'; + 'mailq_path': value => '/usr/bin/mailq.postfix'; + } } 'Debian': { @@ -183,17 +189,6 @@ class postfix( 'inet_interfaces': value => $inet_interfaces; } - case $::operatingsystem { - RedHat, CentOS: { - postfix::config { - 'sendmail_path': value => '/usr/sbin/sendmail.postfix'; - 'newaliases_path': value => '/usr/bin/newaliases.postfix'; - 'mailq_path': value => '/usr/bin/mailq.postfix'; - } - } - default: {} - } - postfix::mailalias {'root': recipient => $root_mail_recipient, } -- cgit v1.2.3