--On Friday, November 07, 2014 06:39:41 PM +0100 Felix Frank <
felix...@alumni.tu-berlin.de> wrote:
> On 11/07/2014 03:40 PM, jcbollinger wrote:
>> If you need to support multiple some::fun_instances, with some but not
>> all sharing any given $sname (i.e. a many to many relationship), then
>> you're going to need to make deeper changes.
The more I think about what I implemented the less I like it. The goal
had been to allow the pattern:
fragment{'one': ensure => present}
fragment{'two': ensure => present}
But I will need to change the pattern to:
setup:{'server': ensure => present}
fragment{'one': ensure => present}
fragment{'two': ensure => present}
> Yeah.
>
> FWIW, this is the one use case that worries me most when thinking about
> patterns to eliminate the defined() horror.
>
> define something::specific($group) {
> file { "/things/$group/$name": }
> if !defined( File["/things/$group"] ) {
> file { "/things/$group": ensure => directory }
> }
> }
Yes, I like that. Let me know when I can use it. ;-)
> I.e., a defined type of which some but not all instances depend on a
> shared resource. Constraints could ensure a consistent catalog, but how
> can the dependency be automatically satisfied without defined() or
> ensure_resource()?
>
> I'm toying with ideas for allowing multiple declarations of the same
> resource. That will pose other exiting issues, but might be the least
> painful way.
>
> Sorry for derailing, I just wanted to note that here ere I forget.
Not a problem. Thanks for thinking about it.
Bill
--
Bill MacAllister
System Programmer, Stanford University