Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Add install_git flag #168

Closed
dragrom opened this issue Nov 10, 2016 · 6 comments
Closed

Add install_git flag #168

dragrom opened this issue Nov 10, 2016 · 6 comments
Assignees
Labels

Comments

@dragrom
Copy link

dragrom commented Nov 10, 2016

Description

I already installed the git as package into my environment

Steps to reproduce

include nodejs in my module give the error: Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Duplicate declaration: Package[git] is already declared;

@Ma27
Copy link
Collaborator

Ma27 commented Nov 10, 2016

may I ask how you're installing git?
We're using the ensure_packages() function, so when you install it the same way (with ensure_packages and the ensure => installed argument) there shouldn't be any conflict. (See here: https://github.com/willdurand/puppet-nodejs/blob/master/manifests/instance/pkgs.pp#L22-L24)

Furthermore I planned to evaluate whether or not git as dependency is really needed: I removed a lot of old code before releasing 2.0.0-alpha1 and it might be possible that the whole dependency is obsolete (will care about this before release 2.0.0-alpha2)

@Ma27
Copy link
Collaborator

Ma27 commented Nov 10, 2016

might be related to older issues such as #34 or #93 ...

@Ma27
Copy link
Collaborator

Ma27 commented Nov 10, 2016

I think I've found the cause.
The ensure_packages function uses the ensure_resource function internally.
This creates new resources using create_resources if defined_with_params evaluates to false (https://github.com/puppetlabs/puppetlabs-stdlib/blob/master/lib/puppet/parser/functions/ensure_resource.rb#L38-L44)

If you omit the ensure => installed argument (in the pkgs.pp it's added) it might cause conflicts.

/cc @willdurand I think you had to deal with this some years ago, this might be the cause...

@dragrom
Copy link
Author

dragrom commented Nov 10, 2016

Maybe this will solve the problem:
class nodejs::instance::pkgs($install_ruby = false, $make_install = false, $install)git = true)
if $install_git {
ensure_packages(['git'], { ensure => installed })
}

And remove git from ensure_packages(['tar', 'git', 'wget'], {
ensure => installed,
})

@Ma27
Copy link
Collaborator

Ma27 commented Nov 10, 2016

possibly.

But I'd rather like to investigate whether we really need git. As I mentioned, it might have been obsolete since 2.0.0-alpha1.

But to fix your problem: would you mind showing me how you install git in your puppet code? We might find a way to solve this before a 2.0.0-alpha2 release.

@Ma27
Copy link
Collaborator

Ma27 commented Dec 4, 2016

@dragrom I just dropped the git usage entirely since it's not required for the actual installation (see my comment in #106 for more information)

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

No branches or pull requests

2 participants