On FreeBSD 11.2-RELEASE-p4, my sendmail.cf file ships with this...
$ fgrep AliasFile /etc/mail/sendmail.cf
O AliasFile=/etc/mail/aliases
https://github.com/smoeding/puppet-sendmail/blob/master/manifests/aliases/file.pp#L29 is hard-coded to use the params class; https://github.com/smoeding/puppet-sendmail/blob/master/manifests/params.pp#L24 allows no adjustment.
My workaround is to just symlink and require/notify the appropriate classes.
case $::kernel {
'FreeBSD': {
# The sendmail module does not yet have an easy way to adjust the
# AliasFile parameter in sendmail.cf and in FreeBSD the default
# is /etc/mail/aliases. We work around that by making a symlink.
file { '/etc/mail/aliases':
ensure => 'link',
target => '../aliases',
before => Class['sendmail::aliases'],
notify => Class['sendmail::aliases::newaliases'],
}
} default: {
#NOOP
}
}
It would probably be nice to be able to adjust the AliasFile line per a variable in the init class or the like.
That said, this tickles a broader issue, which I am not sure you'd want to tackle, here. That said, I'll mention it: with the conversion to no-Puppet-3-compatibility that happened this year... calling variables from params.pp should probably be avoided per https://www.devco.net/archives/2013/12/09/the-problem-with-params-pp.php . I would suggest a conversion to YAML similar to https://github.com/puppetlabs/puppetlabs-ntp/tree/master/data, which -- in my experience -- makes it easier to deal with multi-OS nuance like this for both coder and user alike, since it puts all variables into Hiera (and thus tunable by users).
Looks like there are ~22 classes to deal with per fgrep -R 'include ::sendmail::params' manifests/ | wc -l. I'd be willing to consider doing a PR to help, but will warn that it would take me a few weeks, based on my travel schedule.
On FreeBSD 11.2-RELEASE-p4, my sendmail.cf file ships with this...
https://github.com/smoeding/puppet-sendmail/blob/master/manifests/aliases/file.pp#L29 is hard-coded to use the params class; https://github.com/smoeding/puppet-sendmail/blob/master/manifests/params.pp#L24 allows no adjustment.
My workaround is to just symlink and require/notify the appropriate classes.
It would probably be nice to be able to adjust the
AliasFileline per a variable in the init class or the like.That said, this tickles a broader issue, which I am not sure you'd want to tackle, here. That said, I'll mention it: with the conversion to no-Puppet-3-compatibility that happened this year... calling variables from
params.ppshould probably be avoided per https://www.devco.net/archives/2013/12/09/the-problem-with-params-pp.php . I would suggest a conversion to YAML similar to https://github.com/puppetlabs/puppetlabs-ntp/tree/master/data, which -- in my experience -- makes it easier to deal with multi-OS nuance like this for both coder and user alike, since it puts all variables into Hiera (and thus tunable by users).Looks like there are ~22 classes to deal with per
fgrep -R 'include ::sendmail::params' manifests/ | wc -l. I'd be willing to consider doing a PR to help, but will warn that it would take me a few weeks, based on my travel schedule.