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

Install unzips conditionally #185

Closed
wants to merge 4 commits into from

Conversation

bearrito
Copy link

A fix for the following issue we have encountered

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Duplicate declaration: Package[unzip] is already declared; cannot redeclare at /etc/puppet/modules/consul/manifests/install.pp:19

A fix for the following issue we have encountered

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Duplicate declaration: Package[unzip] is already declared; cannot redeclare at /etc/puppet/modules/consul/manifests/install.pp:19
@solarkennedy
Copy link
Contributor

Yea, puppet and parse order dependent code kinda sucks. I'm guessing you have a package { 'unzip': } somewhere else? (that isn't using ensure_packages)

Looks like there is some trailing whitespace, can you fix the tests?
https://travis-ci.org/solarkennedy/puppet-consul/jobs/80312563

@bearrito
Copy link
Author

I don't have enough ruby/puppet knowledge to fix that failing spec. Any advice on how to proceed?

@solarkennedy
Copy link
Contributor

In general:
https://travis-ci.org/solarkennedy/puppet-consul/jobs/80437216#L160

We tried to ensure that unzip comes before we try to unzip the web file, but it looks like it looks like your code introduced a bug:
https://github.com/solarkennedy/puppet-consul/pull/185/files#diff-a276806bea2dfcf1f57c33aee19c7309R39

Be sure that unzip comes before the normal consul.zip and consul_web

@@ -16,7 +16,9 @@
case $consul::install_method {
'url': {
if $::operatingsystem != 'darwin' {
ensure_packages(['unzip'], { 'before' => Staging::File['consul.zip'] })
if ! defined ( Package['unzip'] ) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you also please remove these additional white spaces?

Something like this is preferable: if !defined(Package['unzip']) {

@solarkennedy
Copy link
Contributor

Closing as we are no longer managing the zip package.

ojongerius added a commit to atlassian/puppet-datadog-agent that referenced this pull request Dec 16, 2015
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.

3 participants