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. :) > 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. The redis module likely uses ensure_resources() to try to avoid module > incompatibility problems arising from duplicate resource declarations. > That is, after all, the function's intended purpose. The module can be > forgiven (but not excused) because general module compatibility is a hard > problem. There was at least one proposal for Puppet 4 that would have made > things a lot easier, but I don't think it made it in. If you can find a > way to replace ensure_resources() with something better, then I would > hope the maintainer would accept it; if he didn't, that's enough of an > improvement to consider forking over. > I'm going to work with the module owner to see if we can't find another solution or I'll use a different module. Thank you very much for the reply. I do appreciate it. Have a great weekend. -Shawn -- 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/745eaa48-9764-40de-b40b-44d21846fedb%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.