voxpupuli / puppet-postfix

Puppet postfix module
Apache License 2.0
70 stars 172 forks source link

Add possibility to specify a template for main.cf #391

Open Rocco83 opened 1 week ago

Rocco83 commented 1 week ago

Affected Puppet, Ruby, OS and module versions/distributions

How to reproduce (e.g Puppet code you use)

One of the widely used postfix module is going to be deprecated soon. https://forge.puppet.com/modules/dhoppe/postfix/readme There is one parameter that can be set to template the main.cf file: $config_file_template Configure the module to use of a template for main.cf file

What are you seeing

The voxpupuli module does not support the template of main.cf file, while it does support master.cf

What behaviour did you expect instead

The support of main.cf template

Output log

N/A

Any additional information you'd like to impart

The support for templating master.cf exists since 2018 https://github.com/voxpupuli/puppet-postfix/pull/91

Is there a reason for which this was not implemented also for main.cf? Would a PR be welcome for this feature?

smortex commented 6 days ago

The module currently rely on augeas to manipulate the main configuration file. This is IMHO very fragile and often lead to broken configuration when applying major changes. Switching to a template would indeed be a major backwards incompatible change but AFAIAC, would be a move in the right direction: augeas is fine for amateur configuration management with orchestration tools like ansible, but I would expect puppet modules to produce deterministic and reproducible configurations. A "production grade" module should not do "soft" configuration (ensure at minimum the manifest config is present in a configuration file) but "hard" configuration (ensure the configuration match exactly what the manifest says).

So :+1: for me!