I've simplified things a bit in the description to make it easy to read.
I don't really have
$apps = {
test => {
url=> "https://mygitrepos/myapp.git",
root=> "/opt/apps/myapp",
user=>"root",
require=>Class[myclass],
}
}
Instead, I pass a YAML hash through an ENC (Foreman to be precise):
test:
url: "https://mygitrepos/myapp.git"
root:"/opt/apps/myapp"
user: root
require: Class[myclass]
I finally understand this won't work because this is expanded to
require=>"Class[myclass]" instead of require=>Class[myclass].
I was mislead by the error message that does not have any quote to
distinguish strings from the rest.
As suggested in the previous post doing :
requirement: myclass
and having into
define application::install($root,$url,$user="root",$requirement=undef)
exec{"$cmd":
command=>$cmd,
unless=>$unless,
user=>$user,
require=>[Package["git"],Class[$requirement]]
}
This is not as powerful as what I intended first (because I'm restricted to
class, not all types I want), but for now, this is enough for my precise
problem.
Thank you very much guys!
>
>
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/ad337de7-b1e7-403f-9ec4-f2c4558c9d03%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.