voxpupuli / puppet-postfix

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

Duplicate declarations when declaring inet_interfaces #280

Closed zangetsu05 closed 4 years ago

zangetsu05 commented 4 years ago

I'm trying to manage the default installation of postfix, to configure some parameters, i've installed the module, and wrote just the first example in the help page but I get an error of duplicated declaration. Tried all the configuration options but always get the duplicate declaration error:

Duplicate declaration: Postfix::Config[inet_interfaces] is already declared at (file: /etc/puppetlabs/code/modules/postfix/manifests/files.pp, line: 90); cannot redeclare (file: /etc/puppetlabs/code/environments/production/modules/foundamentals/manifests/mta.pp

In the mta.pp this is the code:

   include postfix
   postfix::config { 'inet_interfaces':
     value  => 'localhost',
     ensure => present,
   }

What is wrong in this module????

Spent like an hour on this and replaced with file and epp template because also the docs is quite chaotic, options as class or parameter inside the config class, but I'm curious, is this module working or just a some kind of proof of concept not tested in real life?

zangetsu05 commented 4 years ago

It's seems also impossible to set the alias for root...guess what ? Again duplicate declaration... Cannot alias Postfix::Mailalias[root_alias] to ["root"] at (file: /etc/puppetlabs/code/environments/production/modules/foundamentals/manifests/mta.pp, line: 42); resource ["Postfix::Mailalias", "root"] already declared (file: /etc/puppetlabs/code/modules/postfix/manifests/files.pp, line: 109)

What's wrong in this module ???

raphink commented 4 years ago

Thanks for the issue. Please try to give a better description next time; bug triaging is not a fun job so it helps if reporters put some effort into it.

As per the README, the main class allows to set the inet_interfaces parameter directly as a parameter, which is why declaring it separately leads to a duplicate declaration.

Granted, the doc is missing in the README when it comes to the manage_root_alias parameter, which is set to true by default, and uses the value of the root_mail_recipient parameter.

ubellavance commented 4 years ago

@zangetsu05 you should use a more appropriate tone when reporting an issue. I understand that it may be frustrating to work on an hour on a module to try to make it work, and still get errors, but the maintainers are working on this module for free and they're doing their best. As a tip for the future: the code is available and searchable so you can check the module's code to see where the 'problem' can be. Another tip: always start by running the module with no option, then look the result on your client. Then, add options one by one, looking at the changes on your system. Finally, when you create an issue, feel free to offer your help with the documentation if you feel something's wrong or missing.

Note: I'm not one of the maintainers.

raphink commented 4 years ago

@zangetsu05 Now that you know how it works, if you still find the docs "chaotic", I will gladly welcome a pull request to improve it! If you would like the docs to be improved and do not wish to do it yourself, you're also welcome to contact me by email so I can send our rates for paid improvements 😁

zangetsu05 commented 4 years ago

I'm sorry for my "rude" commenting, and if I offended someone, please forgive me, but this module is not well developed, to implement it you need to spend quite the time, read the code in the module to understand how to do some basic configurations and this flamed my nerves..

I don't know why some parameter are configurable by the postfix::config and others must be configured as a parameter of the class, and we are talking in the end of parameters in one file for example the main.cf. What i see is a module started to do some operations in a way and in the middle of the develop changed that way in another but the develop made initially wasn't converted in the new way and for example to manage the main.cf is needed to work with two block of code... And as a parameter of the class you find parameters from different files of postfix, understand why is chaotic ?

The docs, himo, is poor of examples and is not clear about the two way of configurations and the fact that what is a parameter isn't possibille to manage via the postfix::config, or the alias of the root user, in the end following a logic used normally in most of the puppet module you fall in error of duplication, here where I find a chaotic way to manage a daemon that have a lot of config files.

ubellavance commented 4 years ago

Honestly, one hour of work to make a puppet module is not that much. I have implemented this module where I work and I'm far from being a puppet expert. There are better modules, and there are worse. A lot of Puppet modules need a few hours to learn and many are "chaotic" like this one because they're maintained for free by volunteers and they often don't have the time to follow all the changes in all Linux distros, for example. If you want only "easy" modules, you should only use modules that are labelled as "Supported" on the Forge. But don't expect a quick response like this if you run into an issue. Using free stuff will often mean that you have to work more. If you want to have the perfect module, you can either write your own, pay an expert to do it, or contribute to this one until it is perfect for you. All the modules that are not from puppetlabs are community modules, and that means that everyone can contribute to them on Github. You should at least show a bit of gratitude for the module itself, and for the fact that @raphink answered your question very quickly. Complaining will not help you get any work done.

raphink commented 4 years ago

Well, @zangetsu05, you are right!

This module was developed for a very specific need at Camptocamp, over 12 years ago (I don't know when it was started, just that we imported it from a previous bzr code base back in 2008), at a time when hardly anyone used Puppet and the Puppet Forge didn't exist.

Since then, we have worked to maintain this module and make it evolve without breaking the API people had been used to for all these years. It's understandable that 12+ years of development without any specific funding might end up a bit "chaotic" imo.

So I'll just reiterate my invitation: I'll happily welcome you to join the 50+ contributors who have kept this module afloat for the last decade if you want to help make this a great module. I'll also welcome your financial contribution if you wish to contact me for a quote on how we can improve this module for your needs.