We're using ::params classes quite extensively to share values across all
classes in a module:
class myclass (
$param1 = $myclass::params::param1
) inherits myclass::params {
... code ...
}
class myclass::subclass (
$param1 = $myclass::params::param1
) inherits myclass::params {
... code ...
}
define myclass::definetype (
$param2 = 'value2'
) {
include myclass::params
myvalue = $myclass::params::param1
}
class myclass::params () {
$param1 = 'value'
}
The goal is that these values can be set in one place and get used
everywhere throughout the module.
This works just for for classes inside the module, because the 'inherits'
forces the ::params class to be processed first.
However, we consistently run into issues using define types from the module
- we can't figure out how to guarantee that the ::params class gets loaded
before the define types.
(Scope(Myclass::Definetype[resourcename])) Could not look up qualified
variable 'myclass::params::param1'; class myclass::params has not been
evaluated
I'm hoping there's something fairly simple I'm forgetting about that we can
use to force the class to be evaluated before any instance of the types.
--
You received this message because you are subscribed to the Google Groups
"Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-dev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.