On Wed, Dec 03, 2014 at 08:48:39AM -0800, Steve Neuharth wrote:
> I'm writing a module to configure Oracle Weblogic (against my will).
> 
> I've created a type to handle the configuration of the config.xml file for 
> the domain. In puppet, you'd use it like this:
> 
>   weblogic_domain{ $name:
>     admin_server => $admin_server,
>     domains_dir  => $domains_dir,
>     require      => Exec["creating admin server for ${domain}"]
>   }
> 
> so that's great... If i change my $admin_server, then my type changes 
> admin_server in config.xml.
> 
> I'm having a bit of trouble, however, with the next part. A 'domain' in 
> weblogic contains 'servers'... basically a hostname and port. I *could* do 
> this:
> 
>   weblogic_domain{ $name:
>     admin_server => $admin_server,
>     domains_dir  => $domains_dir,
>     servers          => $hash_of_servers_and_ports
>     require      => Exec["creating admin server for ${domain}"]
>   }
> 
> but what I'd really like to do is on each server, declare something like 
> this:
> 
>   @weblogic_server{ $name:
>     domain => myDomain
>     port => 8000
>   }
> 
> and then have my type gather up all the virtual resources and drop them 
> into the server.xml automagically.
> 
> SO... how do I access the instances of one type from a different type? Can 
> it be done? I've read the O'Reilly book on Types/Providers, skimmed a 
> couple other books and scoured github for an example of this but I've come 
> up with nothing.
> 
> please sir, a tuppence for a clue

This is pretty much exactly what datacat_collector does with its
datacat_fragment resources, so I think you'll find your answer if you
look at its code (or simply rework your stuff in terms of that)

https://forge.puppetlabs.com/richardc/datacat
https://github.com/richardc/puppet-datacat


-- 
Richard Clamp <[email protected]>

-- 
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/20141203171346.GA5910%40banner.unixbeard.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to