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:
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 puppet-dev+...@googlegroups.com.
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.
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:
- 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.
- 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.
- Just use some environment variables. This doesn’t fit well within a Puppet workflow
- Use an external fact. This seems like misuse of a Fact, But it is easy to access this information in a custom provider