On 30/08/2007, Steve Caldwell <info-puppet@caldwellhb.com>
wrote:> Can you use exported virtual resources with custom definitions? As an
> example, with the following definition:
>
> define vr-tester() {
> file {
> "/tmp/vr-success.txt":
> content => ''foobar'';
> }
> }
>
>
> this code is working for me:
>
> class testme {
> @vr-tester { "foobar": ; }
> Vr-tester <||>
> }
>
>
> but this is not:
>
> class testme {
> @@vr-tester { "foobar": ; }
> Vr-tester <<||>>
> }
>
> Using a standard puppet type like ''file'' is working fine
for me as an
> exported resource.
>
If I''m not mistaken, this actually exports all the constituent parts
of the define, so in the example given you could do:
File <<||>>
and collect that. That''s not very helpful of course, as defines are
usually made up of a number of different resources, and besides, you
might have files exported elsewhere that you wouldn''t want collected
here.
This did get me thinking, though, as one solution could be if there
were a catch-all to collect *all* exported resources, something like:
Resource <<||>>
Because then it would be simple to tag the define with a unique tag
and then collect everything with that tag:
Resource <<| tag == "unique_define_tag" |>>
This would basically give you the basic functionality, right?
Luke, what do you think of this? Would it work? Would this be an easy
(or, easier) stop-gap measure for this particular problem? If so, do
you have pointers to where I could start looking at building a patch
for this?
Gr,
Thijs
> -Steve
>
> _______________________________________________
> Puppet-users mailing list
> Puppet-users@madstop.com
> https://mail.madstop.com/mailman/listinfo/puppet-users
>