voxpupuli / puppet-postfix

Puppet postfix module
Apache License 2.0
72 stars 176 forks source link

[3.1.0] Add support for RHEL9 #354

Closed tuxmaster5000 closed 1 year ago

tuxmaster5000 commented 1 year ago

Until now the module fails on RHEL9, because the package mailx was replaced by s-nail. Code:

Error: Execution of '/usr/bin/dnf -d 0 -e 1 -y install mailx' returned 1: Error: Unable to find a match: mailx
Error: /Stage[main]/Postfix::Packages/Package[mailx]/ensure: change from 'purged' to 'present' failed: Execution of '/usr/bin/dnf -d 0 -e 1 -y install mailx' returned 1: Error: Unable to find a match: mailx (corrective)
Notice: /Stage[main]/Postfix::Files/File[/etc/aliases]: Dependency Package[mailx] has failures: true
Warning: /Stage[main]/Postfix::Files/File[/etc/aliases]: Skipping because of failed dependencies
Warning: /Stage[main]/Postfix::Files/File[/etc/postfix/master.cf]: Skipping because of failed dependencies
Warning: /Stage[main]/Postfix::Files/File[/etc/postfix/main.cf]: Skipping because of failed dependencies

Reference: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/considerations_in_adopting_rhel_9/assembly_changes-to-packages_considerations-in-adopting-rhel-9#package-replacements_assembly_changes-to-packages

tuxmaster5000 commented 1 year ago

Workaround:

  if (($facts['os']['family'] == 'RedHat') and (Integer($facts['os']['release']['major']) >=9 )) {
    class { 'postfix::params':
      mailx_package => 's-nail'
    }
  }
  class { 'postfix' ...
smortex commented 1 year ago

Hum, it seems we already added this in d6e6156151ac76963bd1dabbb172da92687fa8fa, released in v3.0.0.

Maybe we are just missing to list "RedHat 9" in metadata.json, do you want to contribute a PR for that?

tuxmaster5000 commented 1 year ago

Using it on 9.1 will fails, because the module will try to install the package mailx. When you can tell me, which class are effected then I can create one.

jcpunk commented 1 year ago

I only see this error on puppet8, with puppet7 the values work as expected.

smortex commented 1 year ago

Ah! We currently do not test Puppet 8 (some tooling is WIP for our CI to be able to test this). This behavior is probably related to legacy facts in https://github.com/voxpupuli/puppet-postfix/blob/master/hiera.yaml#L13-L14: Puppet 8 does not produce them by default, so part of Hiera config is not read with Puppet 8 while it was with Puppet 7.

Can be workaround by re-enabling legacy facts or updating them to replace them with the current ones.

ekohl commented 1 year ago

It was added to metadata in #375 so closing this.

Also, in 33604bd1600d33064e80d491dcd2c83b3d940e55 the params were rewritten to use Hiera, so I wonder which version of the module you're using.