Skip to content

Commit 86e5072

Browse files
authored
Merge pull request #423 from vchepkov/alternative
feat: make mta alternative configurable
2 parents c92ebde + 8c81a5c commit 86e5072

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

REFERENCE.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ The following parameters are available in the `postfix` class:
125125
* [`masquerade_classes`](#-postfix--masquerade_classes)
126126
* [`masquerade_domains`](#-postfix--masquerade_domains)
127127
* [`masquerade_exceptions`](#-postfix--masquerade_exceptions)
128+
* [`mta_bin_path`](#-postfix--mta_bin_path)
128129
* [`mta`](#-postfix--mta)
129130
* [`mydestination`](#-postfix--mydestination)
130131
* [`mynetworks`](#-postfix--mynetworks)
@@ -488,6 +489,15 @@ Example: `['root']`
488489

489490
Default value: `undef`
490491

492+
##### <a name="-postfix--mta_bin_path"></a>`mta_bin_path`
493+
494+
Data type: `Optional[Stdlib::Absolutepath]`
495+
496+
An optional path for mta 'alternative'.
497+
Example: `'/usr/sbin/sendmail.postfix'`
498+
499+
Default value: `undef`
500+
491501
##### <a name="-postfix--mta"></a>`mta`
492502

493503
Data type: `Boolean`

data/osfamily/RedHat.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ postfix::params::aliasesseltype: 'etc_aliases_t'
33
postfix::params::seltype: 'postfix_etc_t'
44
postfix::params::restart_cmd: '/bin/systemctl reload postfix'
55
postfix::params::master_os_template: 'postfix/master.cf.redhat.erb'
6+
postfix::mta_bin_path: '/usr/sbin/sendmail.postfix'
67
...

manifests/init.pp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,10 @@
191191
# subjected to address masquerading, even when their addresses match $masquerade_domains.
192192
# Example: `['root']`
193193
#
194+
# @param mta_bin_path
195+
# An optional path for mta 'alternative'.
196+
# Example: `'/usr/sbin/sendmail.postfix'`
197+
#
194198
# @param mta
195199
# A Boolean to define whether to configure Postfix as a mail transfer agent.
196200
# This option is mutually exclusive with the satellite Boolean.
@@ -295,6 +299,7 @@
295299
Optional[Array[String[1]]] $masquerade_classes = undef,
296300
Optional[Array[String[1]]] $masquerade_domains = undef,
297301
Optional[Array[String[1]]] $masquerade_exceptions = undef,
302+
Optional[Stdlib::Absolutepath] $mta_bin_path = undef,
298303
Boolean $mta = false,
299304
String $mydestination = '$myhostname, localhost.$mydomain, localhost', # postfix_mydestination
300305
String $mynetworks = '127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128', # postfix_mynetworks

manifests/service.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
require => Service['postfix'],
3030
}
3131
}
32-
if $facts['os']['family'] == 'RedHat' {
32+
if $postfix::mta_bin_path {
3333
alternatives { 'mta':
34-
path => '/usr/sbin/sendmail.postfix',
34+
path => $postfix::mta_bin_path,
3535
require => Service['postfix'],
3636
}
3737
}

0 commit comments

Comments
 (0)