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

ensure_packages unzip with 'before' breaks interoperability #187

Closed
ilyash-p opened this issue Sep 20, 2015 · 5 comments
Closed

ensure_packages unzip with 'before' breaks interoperability #187

ilyash-p opened this issue Sep 20, 2015 · 5 comments

Comments

@ilyash-p
Copy link

In install.pp there is

ensure_packages(['unzip'], { 'before' => Staging::File['consul.zip'] })

which breaks interoperability since if you have

ensure_packages(['unzip'])

in any other place it's a redeclaration error (because attributes are different). Minimal code that shows similar problem:

puppet apply -e 'ensure_packages(["unzip"]) ensure_packages(["unzip"], {stage=>"main"})'

Output excerpt:

Error: Duplicate declaration: Package[unzip] is already declared
@ilyash-p
Copy link
Author

Possible solution: "Remove management of unzip package" - danieldreier@8253cba

@solarkennedy
Copy link
Contributor

Fixed by #185

@hopperd
Copy link
Contributor

hopperd commented Mar 25, 2016

Closing since this is fixed.

@hopperd hopperd closed this as completed Mar 25, 2016
@Cinderhaze
Copy link

There is another solution. (just ran into this in my copy of 1.0.2)

If you put the relationship after the ensure_packages, it can work without breaking other ensure_packages.

ensure_package('unzip')
Package['unzip'] -> Staging::File['consul.zip']

This allows you to still ensure that the package is managed, but doesn't cause a Duplicate Declaration error. I'm guessing it's similar to the

include 'myclass'

vs

class:{'myclass':}

schematics.

@solarkennedy
Copy link
Contributor

That will still cause the duplication error if another user declares (not via ensure_packages) unzip before consul is parsed.

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

4 participants