thias / puppet-postfix

Puppet Postfix module
Other
17 stars 117 forks source link

Files main.cf and master.cf fail with missing /etc/postfix #13

Closed chrisrob closed 11 years ago

chrisrob commented 11 years ago

When installing from scratch (apt-get purge postfix) puppet apply fails because /etc/postfix is missing because package is not installed yet.

I added "require => Package['postfix']," to the two file resources in server.pp and then all installed with no problems.

thias commented 11 years ago

Are you using the master branch? Because this seems a lot like #12 which has been fixed in 9169a4aafac7e4d3797336576df68869e482d268.

Maybe you're running the latest release on the forge? In which case it might be time for an update there!

thias commented 11 years ago

I've released 0.2.4 to the forge.

chrisrob commented 11 years ago

On 28/10/2013 12:07, Matthias Saou wrote:

I've released 0.2.4 to the forge.

— Reply to this email directly or view it on GitHub https://github.com/thias/puppet-postfix/issues/13#issuecomment-27199979.

Lovely. I'll redo 'module install thias/postfix' and run a diff on the old and new to see what else may have changed.

Thanks for all your other forge modules. Nice clean approach which is simple to follow yet makes me glad I don't have to try and do it myself.

Just a small comment on postfix; main.cf can potentially have a huge number of parameters. Inevitably there were a few that I use that were hardcoded in your template instead of using variables.

I thought I would copy your main.cf.erb to my template directory, make my changes, then override the File resource for main.cf to point to mine.

It was then that I learned about the inability to inherit a parameterised class. Since one can't inherit your 'postfix::server' parameterised class and then override the main.cf File resource I had to modify the template in situ. I prefer to leave the forge modules untouched and modify their behaviour from site.pp.

Chris

thias commented 10 years ago

Would you maybe like me to implement something similar to what I did in the vsftpd module?

See https://github.com/thias/puppet-vsftpd/issues/6 for some details. In addition to using any external template, you can also use a provided empty one and pass all options inside a single hash parameter. I'd have to look at the syntax of all postfix configuration options to make sure it can all be mapped to a hash, just to make sure.

chrisrob commented 10 years ago

On 30/10/2013 17:00, Matthias Saou wrote:

Would you maybe like me to implement something similar to what I did in the vsftpd module?

See thias/puppet-vsftpd#6 https://github.com/thias/puppet-vsftpd/issues/6 for some details. In addition to using any external template, you can also use a provided empty one and pass all options inside a single hash parameter. I'd have to look at the syntax of all postfix configuration options to make sure it can all be mapped to a hash, just to make sure.

I had a look at the vsftpd link. I'm happily using your (modified) original postfix module so please don't expend any effort on my account. If you're thinking of doing something anyway then I have two suggestions, aimed at keeping it simple.

One is to simply provide an extra hash parameter called 'extra_params' or something. You could then expand these at the bottom of your current template. They would add to, or override, the params above them because postfix allows duplicate params and only remembers the last one.

This would mean that most users of your module wouldn't have to do anything extra, but the minority of awkward buggers like me would be able to indulge their idiosyncracies.

The other approach would be to just wait for Puppet to implement inheritable parameterised classes. I know nothing about Ruby but, unless there is some reason why it is impossible in that language, that would solve many problems for many people.

thias commented 10 years ago

OK, I'll keep this in mind, and will probably make these kind of changes to the module at some point. Thanks for the feedback!