Issue #7240 has been updated by John Bollinger.

So, once this is implemented, the 'realize' function will be the only way to 
realize virtual resources?  How could one then use selection predicates to 
choose which resources to realize?

Also, the issue description doesn't mention exported resources, and it sounds 
like implementing this change might break the longstanding parallelism between 
collecting virtual resources and collecting exported ones.  That would be 
unfortunate.

I think there are *three* separate actions to consider here:

1) realizing virtual resources

2) 'realizing' exported resources (meaning declaring that certain exported 
resources should be applied to the target node, which is not currently possible 
without using a collection)

3) collecting resources

>From my perspective, (1) and (2) differ only in where Puppet looks for the 
>relevant resource definitions.  Both transition resources from being (only) 
>defined to being declared for the target node, and both benefit from the 
>ability to use selection predicates to choose resource definitions to act upon.

Furthermore, there is no reason why (3) should need to distinguish between 
concrete resources, virtual resources, and exported resources if it is divorced 
from (1) and (2).

With all that said, if Puppet is going to implement this feature, then I would 
like to see the implementation include:

1) giving the 'realize' function the ability to use selection predicates to 
choose virtual resources to realize, or else creating a new function with that 
ability;

2) creating an 'import_resources' function that declares available exported 
resources for the target node, filtered by selection predicates at user option;

3) making the ordinary collection syntax apply to all resources declared for 
the target node, including those having virtual or exported definitions;

4) deprecating or removing the exported-resource form of the collection syntax, 
which would be redundant


Alternatively, yet another form of the collection syntax could be introduced 
that implements (3), and everything else could be left as it is.  That would 
likely be the easiest to implement, it would surely have the least 
compatibility impact, and I think it would satisfy the objective of this 
feature, but I'm having trouble working up enthusiasm for a *third* collection 
syntax.

John

----------------------------------------
Feature #7240: Split up collecting and realizing.
https://projects.puppetlabs.com/issues/7240

Author: Nigel Kersten
Status: Accepted
Priority: High
Assignee: 
Category: 
Target version: Telly
Affected Puppet version: 
Keywords: 
Branch: 


Currently when you collect resources you also automatically realize them.

We should divorce the two bits of functionality such that you can use 
collections to set up relationships without affecting realization, and allow 
the result of a collection to be the rvalue for a realize function.

Without this it's difficult to express something like:

`PackageRepository <| |> -> Package <| |>`

where you want all resources of a given type to have a relationship with all 
resources of another type.



-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" 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-bugs?hl=en.

Reply via email to