Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to remove unsupported parameters #3

Closed
fraenki opened this issue Feb 19, 2018 · 5 comments
Closed

Unable to remove unsupported parameters #3

fraenki opened this issue Feb 19, 2018 · 5 comments

Comments

@fraenki
Copy link
Member

fraenki commented Feb 19, 2018

Using this module it is possible to configure parameters that are unsupported by the installed postfix. However, it seems to be impossible to remove these parameters:

Error: /Stage[main]/Resources[postconf]: Failed to generate additional resources using 'generate':
  Parameter parameter failed on Postconf[/usr/sbin/postconf:
    warning: /etc/postfix/main.cf: unused parameter: smtputf8_enable]:
    Invalid value "/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtputf8_enable".
  Valid values match /^([^\/]+::)?[a-zA-Z0-9]+(?:_[a-zA-Z0-9]+)*$/.

In this example I've tried to configure a parameter on postfix 2.x which was only introduced in postfix 3.x.
Any idea how to properly remove these parameters with your module? :)

@oxc
Copy link
Collaborator

oxc commented Feb 20, 2018

For the record, the problem is that puppet providers do not support defining commands that do not munge stdout and stderr output (see https://github.com/puppetlabs/puppet/blob/master/lib/puppet/provider.rb#L259). This causes postconf -n output to contain warnings printed to stderr, as can be seen in the quoted error message.

We can either depend on/hack around private puppet API, or fully duplicate (as in copy&paste) the CommandDefiner / Provider#has_command system.

@oxc oxc closed this as completed in 50c965a Feb 20, 2018
@oxc
Copy link
Collaborator

oxc commented Feb 20, 2018

@fraenki please test again with current master

@fraenki
Copy link
Member Author

fraenki commented Feb 20, 2018

@oxc It fixes the Puppet error, which is all I want. Thanks! 👍
But the unsupported parameter remains in Postfix' main.cf.

@oxc
Copy link
Collaborator

oxc commented Feb 20, 2018

But the unsupported parameter remains in Postfix' main.cf.

I cannot confirm that. Are you purging the resources using resource { postconf: purge => true }?

@fraenki
Copy link
Member Author

fraenki commented Feb 20, 2018

I cannot confirm that.

Solved. It was a configuration issue on my side. Now the parameter is removed as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants