Nov 7 15:32:28 gumby puppetd[17245]: Configuration could not be
instantiated: Could not find dependency
File[/opt/jboss/jboss-current/conf/tfel-bindings.xml] for
Service[jboss-tfel2] at
/etc/puppet/modules/jboss/manifests/init.pp:31; using cached catalog
If I replace the File definition in the jboss class from
"/opt/jboss/jboss-$jboss_version/conf/tfel-bindings.xml" to
"/opt/jboss/jboss-$version/conf/tfel-bindings.xml", then puppet does
NOT complain about it. It appears that puppet is treating the two
resources differently, even though they both extrapolate to the same
thing, ie it treats them literally, without regard to what the value
of the variable is. Is this by design?
It's painful, because I wanted to set $jboss_version in the node, pass
it to the definition, and use $version inside the definition. I can't
do that. I have to use the $jboss_version variable.
Doug
define jboss::create_inst($version = "current", $naming_port, $cluster) {
service {
"jboss-$name":
require => [ Package["jboss-server"],
Package["jboss-server-$name"],
File["/opt/jboss/jboss-$version/conf/tfel-bindings.xml"] ],
ensure => running,
enable => true,
hasrestart => true,
hasstatus => true
}
}
class jboss::server {
"/opt/jboss/jboss-$jboss_version/conf/tfel-bindings.xml":
source => "puppet://$server/jboss/conf/tfel-bindings.xml",
require => Package["jboss-server"],
owner => root, group => root;
}
node 'gumby.fr.xxx.com' {
$jboss_version = "4.2.3.GA-1.tf"
jboss::create_inst {
tfel0:
cluster => "c0tfel0",
naming_port => "1099";
}
}
use ${jboss_version} instead of $jboss_version.
http://reductivelabs.com/trac/puppet/wiki/LanguageTutorial#quoting
cheers pete
Douglas Garstang wrote:
> Could not find dependency
> File[/opt/jboss/jboss-current/conf/tfel-bindings.xml] for
> Service[jboss-tfel2] at
> /etc/puppet/modules/jboss/manifests/init.pp:38; using cached catalog
It is expanding ${version} to "current" as shown by the jboss-current
string in your File[]. Is this dependency defined?
cYa,
Avi
Douglas Garstang wrote:
> Yes, it's defined in a class.
Can you pastie the entire thing somewhere? It's difficult to tell if
there is perhaps a scoping issue unless we can see the entire manifest
involved.
cYa,
Avi