Is it possible to do the following?
Create a function foo that returns a list of references to existing
objects.
One would call, say
realize(foo())
or
some_type { "some_name":
.
.
require => foo()
}
and foo would return the equivalent of
[ File['bar'], File['baz'], File['quux'] ]
which would be consumed by the realize function or by the require
metaparameter. It's possible these are two separate cases requiring
different code, which I'd still be interested in finding out about.
But syntactically it appears they are just lists of references that
get flattened somewhere.
I've been looking for documentation but the official name for these
references is "object references" (mentioned on the Puppet
"metaparameters" page under the require metaparameter) and searching
for "puppet object references" in combination with "custom function"
just doesn't return anything that I'm familiar with.
The point I'm most interested in, is how would one create an object
reference to some resource already defined in the manifest, such as
File['bar'], from a custom function written in Ruby. I have
successfully written and debugged custom functions that _don't_ need
to do this.
I find examples of how to create a brand new file object, but not how
to refer to an existing one, in the form used by the require
metaparameter and the realize function
--
You received this message because you are subscribed to the Google Groups
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-dev?hl=en.