Giter Club home page Giter Club logo

Comments (8)

MikeCaspar avatar MikeCaspar commented on July 30, 2024

I am having the same problem on a Ubuntu 14.04 machine. ( I suspect it is fairly universal ).

As a workaround, you could set the desired Maven Version in site.pp

  • Caution: This will likely effect maven installations in your entire environment! *

in site.pp....
$maven_version = '3.2.5'

from puppet-maven.

MikeCaspar avatar MikeCaspar commented on July 30, 2024

Hi there, it turns out this stopped the error but doesn't really work effectively anymore. The variable is used to avoid an additional unnecessary download. Not sure how that would be fixed but

$maven_version = undef

allowed the code to run and execute the download

from puppet-maven.

MikeCaspar avatar MikeCaspar commented on July 30, 2024

Argh.. As it turns out, this works Once.
After that you receive an error that it cannot be re-assigned.

I'll do some searching to see where this variable is set (maybe in facter?).

Hopefully, this gets you through this for now.

from puppet-maven.

MikeCaspar avatar MikeCaspar commented on July 30, 2024

OK.. Played around for a while.
I've found a fix that seems to work well for now and could be migrated to the module itself...

in site.pp...

`
if !getvar('::maven_version')

$maven_version = undef

}
`

The problem seems to arise from maven_version coming from facts. If the fact exists, the variable is available. If the fact does not yet exist, the variable won't exist.

A likely better alternative might be to adjust maven.pp to check for the fact instead of the global variable (as per the above command) but I'm too new to puppet to know if this is a viable option.

from puppet-maven.

af6140 avatar af6140 commented on July 30, 2024

Yes, the strict_variable parameter controls whether use uninitialized variable in puppet, Googled around, there is no elegant solution. I had issue withe getvar also, guess different version of puppet may behave differently, it may also depends on whether you use future_parser.

from puppet-maven.

af6140 avatar af6140 commented on July 30, 2024

Are we the only ones have the issues? Look at the puppet forge, this module is the most popular maven one, wondering what others experienced.

from puppet-maven.

MikeCaspar avatar MikeCaspar commented on July 30, 2024

I have seen this type of thing with a few modules now.

Although I am relatively new to puppet, from what I can see is that the problem is related to "strict variables" as a new approach and defining the scope of a variable properly when accessed. This seems to become more important when referencing facts.

I often see errors as well as it relates to $schedule when trying new modules. I hope that helps.

I have learned to start being careful about using :: when needed to reference higher level variables when needed. Could it simply be related to variable scope?

Sorry I can't help more.. maybe this weekend I might do a fork and play around a bit to see if I can figure it out.

from puppet-maven.

cfiehe avatar cfiehe commented on July 30, 2024

I have created a pull request that should ensure module's compliance with strict_variables=true. I had same trouble with Puppet 3.5.0 and Puppet 3.6.0, but now the change passes all tests.

from puppet-maven.

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.