On Friday, March 27, 2015 at 5:49:54 PM UTC-7, Shawn Sterling wrote:
>
>
>
> On Friday, March 27, 2015 at 6:45:05 AM UTC-7, jcbollinger wrote:
>>
>> ensure_resource() is not a resource declaration; it is a function call 
>> that under some circumstances causes a resource to be declared.  It does 
>> not return a value, and therefore cannot be valid operand for the chain 
>> operators.
>>
>
> Okay, makes sense. 
>  
>
>> Those are all perfectly reasonable approaches.  If they don't work then 
>> I'm inclined to conclude that class 'redis' does not properly contain the 
>> resources it declares.  This may be a result of declaring them via 
>> ensure_resource() 
>> -- especially if the affected resources are first declarded elsewhere -- 
>> or it may be a classic case of failing to contain other classes.
>>
>
> Glad I'm not loosing my mind. :)
>
Arioch's puppet-redis needs an anchor resource to wrap the classes declared 
in the init.pp. You can establish a relationship if you specify an existing 
class with resources (rather the the redis class which only contain 
classes):

repo::epel::add { $epel_packages:
  before => Class['::redis::preinstall'],
}

You could tell me to not use ensure_resources, but I'm not. I'm using 
>>> someone else's module and trying to enforce order at the profile level.
>>>
>>
>> And I *do* tell you not to use ensure_resources(), whether in your own 
>> code or indirectly via someone else's modules.  The only way 
>> ensure_resources() works correctly and reliably is if every resource it 
>> governs is declared *only* via one or more ensure_resources() calls, 
>> with the same parameters and relevant in-scope resource defaults at the 
>> site of every such call.  Even then, "correctly" does not extend to 
>> containment, and cannot do so without creating a grave risk of dependency 
>> cycles.  The ensure_resources() function is not a correct -- nor even a 
>> reasonable -- solution to *any* problem.  That a third party module uses 
>> it is enough reason for me to avoid that module.
>>
>
> I will avoid any module that uses ensure_resources from this point on.
>

Isn't that rather drastic, considering it's an issue with one module, and a 
problem with class containment implementation of that module?

HTH,

Nan

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/9d42c317-4025-45f4-a08a-6c74f6aea667%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to