Closed PeterParker closed 8 years ago
@PeterParker I've just created a bug fix branch (fix_55) that should fix this.
Do you want to give it a spin and let me know?
Cheers Gavin
@fatmcgav -- Unfortunately I'm still seeing the following:
Error: Evaluation Error: Error while evaluating a Resource Statement, Cannot alias File[mysql-connector-java-5.1.36-bin.jar_lib_ext] to ["/usr/local/glassfish-4.0/glassfish/lib/ext"] at /tmp/vagrant-puppet/modules-4fce94448e73ff14a4caeab031861abd/glassfish/manifests/install_jars.pp:84; resource ["File", "/usr/local/glassfish-4.0/glassfish/lib/ext"] already declared at /tmp/vagrant-puppet/modules-4fce94448e73ff14a4caeab031861abd/glassfish/manifests/install_jars.pp:84 at /tmp/vagrant-puppet/modules-4fce94448e73ff14a4caeab031861abd/glassfish/manifests/install_jars.pp:84:5 on node [...]
Which makes sense now I think about it. The alias is only that -- an alias. Puppet is still always going to try and disallow the declaration of two resources that manage the same underlying resource. I guess File
is simultaneously clever enough to work out that the same directory is being managed in both instances, but also dumb enough to not realize the declarations do not contradict each other!
Sorry for leading you down the wrong path on this one.
@PeterParker Ah, yeh... Have hit that scenario before... OK, lets see if I can come up with an alternative...
@PeterParker I've switched to using ensure_resource
, do you want to see if that works?
Need to get a local test working for this aswell :)
@fatmcgav Sure thing. Trying to find the commit, though. Did you push
?
Yep, it should be on the fix_55 branch... a6552211efc84e3d73f82f514c95ecc777912115
I reverted the previous changes aswell, so might just be worth pulling the branch...
@fatmcgav Yep, works for me now. I tried with two jars and both are present when I ssh onto my box.
Many thanks for taking a look at this.
@PeterParker Cool, cheers for confirming.
Will get it tidied up and merged in...
:+1:
Consider the following manifest excerpt, which uses the
glassfish::install_jars
define more than once to specify the "installation" of two jars:This will result in the following compilation error:
Proposed solution is to give the problematic
file
resource an explicit title rather than use the directory name, one which will be unique to every separate install_jar define. The directory path would then have to be moved topath
attribute instead.Current Workaround
My use case in this instance is one where I can do without one jar if the other is installed using a simple
if else
statement, but others may not be so lucky.