You might want to take a look at using Composite Namevars. A good example exists in the java_ks type https://github.com/puppetlabs/puppetlabs-java_ks.
Trevor On Mon, Feb 17, 2014 at 4:53 PM, bert hajee <[email protected]> wrote: > L.S, > > What is the idiomatic Puppet way to get global context in a instances > method for a custom provider? > > I'm building a custom type and provider for some Oracle items. Oracle can > have multiple databases running on a system. So I need a way to tell the > instances method to which database to connect. > > I've got a couple of idea's myself, but don't know which is best and if > there are better ways: > > > 1. Not using the instances method. This means I can use a regular > parameter to specify to which database to connect. But I lose the ability > to list my resources with puppet resource tablespace. > 2. a custom type providing some defaults e.g. > ora_settings{'default': > database => 'mydb'} > And store this information and use it in the regular resources. This > fits well with Puppet, but requires an extra custom type. > 3. Just use some environment variables. This doesn't fit well within a > Puppet workflow > 4. Use an external fact. This seems like misuse of a Fact, But it is > easy to access this information in a custom provider > > Any thoughts are appreciated? > > Bert > > > > > > > > > > > > -- > 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/dd048be9-2a72-4857-a7b5-13aaa96cc2dd%40googlegroups.com > . > For more options, visit https://groups.google.com/groups/opt_out. > -- Trevor Vaughan Vice President, Onyx Point, Inc (410) 541-6699 [email protected] -- This account not approved for unencrypted proprietary information -- -- 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/CANs%2BFoWOUS9UKyDaDoD955dS4wO2RGrkDW_7F3XVgud53x%3DE_g%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
