I thought there were dangers with Virtual Resource being accidentally
realized sometimes?

We found a super-hacky way to call functions at the end of a compile which
we use in
https://github.com/simp/pupmod-simp-compliance_markup/blob/master/manifests/map.pp.
It would be *really nice* if there were an actual 'hook in here, no
resources will be processed after this point' hook.

Trevor

On Mon, Apr 16, 2018 at 5:00 PM, Henrik Lindberg <[email protected]
> wrote:

> On 16/04/18 17:38, Trevor Vaughan wrote:
>
>> How difficult would it be to create a third type of resource which is an
>> 'ephemeral resource' whose only purpose is data collection on a host to be
>> used by some other collector?
>>
>> These items would not be part of the catalog or added to the graph but
>> would instead just hang around for reference during compilation.
>>
>> This would fix the catalog explosion issue when you start doing exported
>> resources based on large numbers of things and/or things like firewall
>> rules and copious file_line resources.
>>
>> Basically, a 'data' -> 'collector' pattern where you can
>> optimize...well...everything into a MUCH smaller catalog that is sent to
>> the client for processing.
>>
>>
> Sounds a bit like the existing virtual resources, but with a better
> collection mechanism. Would not be too difficult to write a function that
> takes a data type predicate to match against virtual resources
> data type predicate) and then calling a lambda with each.
>
> Virtual resources do not end up in the catalog unless they are realized.
> With the function I imagined, you would select virtual resources and then
> do whatever you want in the lambda.
>
> The function should probably return an Iterator over the resources. That
> can then be iterated with each, map, or reduce.
>
> The issue then is when to call that function - you want it at the very end
> which we do not have a mechanism for.
>
> The virtual collector could be modified to accept a lambda - since
> collection runs late it would be at the right time. This is a much bigger
> change naturally as it changes the language.
>
> - henrik
>
>
> --
>
> Visit my Blog "Puppet on the Edge"
> http://puppet-on-the-edge.blogspot.se/
>
> --
> 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 view this discussion on the web visit https://groups.google.com/d/ms
> gid/puppet-dev/pb32pa%24d3q%241%40blaine.gmane.org.
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Trevor Vaughan
Vice President, Onyx Point, Inc
(410) 541-6699 x788

-- This account not approved for unencrypted proprietary information --

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-dev/CANs%2BFoUUaCqmHhKjUWiFRyqFF3%2Bc5BpgLEHe-faYZxcyUutcGA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to