Git Product home page Git Product logo

Comments (12)

dwerder avatar dwerder commented on July 30, 2024

Ok, i see the prob. If you have a good solution for arrays I will merge it happily :)

from puppet-graphite.

dwerder avatar dwerder commented on July 30, 2024

The defined function can be a pain in the ass, because if you have multipe defineds with different parameters. e.g. one installes

if ! defined(Package['gcc']) {
    package { 'gcc': ensure => installed }
  }

and another

if ! defined(Package['gcc']) {
    package { 'gcc': ensure => "4.2.3" }
  }

then its just luck which of them wins and will be executed.

So maybe the best way will be to just replace the package install part with an exec command like "yum -q -y install foo bar"

from puppet-graphite.

nibalizer avatar nibalizer commented on July 30, 2024

I would recommend adding a $manage_packages option to the main graphite class. This class is how the user decides if the graphite module is managing the packages (in the only-graphite use case) or if the packages will be managed outside the graphite class (more of a roles/profiles use case).

from puppet-graphite.

petems avatar petems commented on July 30, 2024

Agree with @nibalizer, I asked the guys on #puppet-dev and they said that the only real way of handling it

Alternatively, there's a method in https://github.com/puppetlabs/puppetlabs-stdlib to check an array of packages with ! defined(Package['foo']), more hacky though.

from puppet-graphite.

neoice avatar neoice commented on July 30, 2024

I wanted to experiment with Graphite today and hit this issue:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Duplicate declaration: Package[git] is already declared in file /etc/puppet/modules/graphite/manifests/install/redhat.pp:26;

from puppet-graphite.

dwerder avatar dwerder commented on July 30, 2024

So it looks like another module of yours already installs git. An easy workaround is just to remove the git package from the list of the packages to be install for redhat in the params.pp

from puppet-graphite.

neoice avatar neoice commented on July 30, 2024

I'd like to vote for the $manage_packages params.

I can easily exclude the offending module (it's part of my sysadmin::base role), but workarounds aren't long-term solutions :) I am already doing this in my test environment.

from puppet-graphite.

nibalizer avatar nibalizer commented on July 30, 2024

! defined() is not a good pattern as it is parse-order dependent.

from puppet-graphite.

nibalizer avatar nibalizer commented on July 30, 2024

#52

from puppet-graphite.

dwerder avatar dwerder commented on July 30, 2024

This issue should be solved with release 6.0.0. See #48 . At least for RedHat distros.

from puppet-graphite.

dwerder avatar dwerder commented on July 30, 2024

Their was a whole refactoring of the module since this is issue was created. Is it still up-to-date?

from puppet-graphite.

petems avatar petems commented on July 30, 2024

@dwerder Let me double check.

In the mean time, I'm making a basic Beaker test to check this scenario, PR coming soon! 👍

from puppet-graphite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.