Collect variables from several resources into one variable?
Consider a module that declares the class module::singleton
and defines the type module::many
. Is there any way for the class to see the names of the defined types? Here's an example:
class module::singleton {
$foo = declared_names_of_type(module::many) //This doesn't work. Can it even be done?
}
define type module::many { }
include module::singleton
module::many {'first':}
module::many {'second':}
To be more specific, I'm working on a module for SSSD. The config file for SSSD requires that each domain is named at the top, and also has its own config stanza down below. It looks ...
Seems like the spaceship operator might be able to make this work somehow, but I can't figure it out. http://docs.puppetlabs.com/puppet/2.7/reference/lang_collectors.html