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

error when mailx package already defined #141

Closed
wants to merge 1 commit into from
Closed

error when mailx package already defined #141

wants to merge 1 commit into from

Conversation

wyardley
Copy link
Contributor

I had an issue where even when invoking with
class { 'postfix': mailx_ensure => False }
I got the error:
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Duplicate declaration: Package[mailx] is already declared in file /etc/puppet/modules/base/manifests/install.pp:36; cannot redeclare at /etc/puppet/modules/postfix/manifests/packages.pp:11 on node xxxx Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run
Didn't seem to work to just wrap in a
if $postfix::mailx_ensure {
so this seems to be the easiest way to work around a situation where the mailx package is already defined (I tried using ensure_packages() instead in the place where we define it, but that didn't work either).

@wyardley
Copy link
Contributor Author

Not sure about the ones that failed, looking through the log, seems like not related to this change, but an ssh connection error?

@raphink
Copy link
Member

raphink commented Aug 17, 2016

It doesn't shock me that the postfix module would install the mailx package. I would recommend that you remove it from your base module instead.

@wyardley
Copy link
Contributor Author

The PR doesn't stop installing mailx, it just makes it a softer dependency.

Just because it "doesn't shock" you, doesn't mean it's a good idea, unless it's depended on for some functionality of the module, having mailx isn't necessary for installing / configuring Postfix, and I would argue that they serve different functions (MUA vs. MTA).

People may not be including the Postfix module on all their systems (as is the case for us), or may have other modules which also install it mailx.

I think the failing tests are due to an unrelated issue (you'll see that all recent PRs are failing checks).

@raphink
Copy link
Member

raphink commented Aug 18, 2016

OK. In that case, please add a $manage_mailx boolean parameter to the class to opt-out from managing this package altogether. This will avoid "magic" dynamic management of resources, which makes debugging a headache.

@wyardley
Copy link
Contributor Author

Sure, makes sense. Will make a new PR for that

@wyardley
Copy link
Contributor Author

#143

raphink pushed a commit that referenced this pull request Aug 22, 2016
* Add $manage_mailx boolean to control whether mailx is managed (replacement for PR #141)

* add more docs for $manage_mailx

* fix scope of variable
crispygoth pushed a commit to crispygoth/puppet-postfix that referenced this pull request Nov 22, 2016
…uli#143)

* Add $manage_mailx boolean to control whether mailx is managed (replacement for PR voxpupuli#141)

* add more docs for $manage_mailx

* fix scope of variable
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

Successfully merging this pull request may close these issues.

2 participants