fragments = *resource.catalog.resources.find_all *do |r|  r.is_a?(
*Puppet::Type.type(:datacat_fragment)*) && ((our_names & [ r[:target] 
].flatten).size > 0)  end
that's the nugget I was looking for. I think that should work very nicely.

Thank you very much,
--steve

On Wednesday, December 3, 2014 11:15:23 AM UTC-6, Richard Clamp wrote:
>
> 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] <javascript:>> 
>

-- 
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/b21868fe-0262-4161-9a45-aaa29370f092%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to