Bert Cheers for the suggestion - I'll take a look at easy_type and see if it fits...
However I've written both prefetch and non-prefetch style providers before, just not combined a prefetch provider with resource param values... :) Cheers Gavin On Friday, 27 June 2014 12:30:13 UTC+1, bert hajee wrote: > > Maybe easy_type <https://github.com/hajee/easy_type> can help you to make > it easy to make a custom type. This takes some of the hard work in making a > custom type away fro you, so you can focus on the content. > > We have used easy_type to build custom types for Oracle > <https://github.com/hajee/oracle> and webLogic > <https://github.com/biemond/biemonds-orawls> > > Let me know how it goes. > > Regards, > > Bert > > Op vrijdag 27 juni 2014 13:14:37 UTC+2 schreef Gavin Williams: >> >> Morning All >> >> I'm starting to work on a new module[1] to support installation and >> configuration of Apache Karaf. >> >> I've got most of the ground-work laid down, and I'm now starting to work >> on types and providers to model the various Karaf resources that might need >> to be managed... >> >> The first one on my list is 'feature', which is effectively the Karaf >> equivalent of a package. I'm trying to write the providers using a >> prefetch/flush style to make them as efficient as possible, as the >> aspiration is for Karaf and the Puppet management agent to be run on >> minuscule hardware, so reducing the processing required as much as possible >> is essential... Anyhow, enough background, onto the issue... >> >> The initial version of my type, provider and provider parent look like >> [2][3][4]. >> The 'karaf_feature' provider is using a helper function in >> 'Puppet::Provider::Karaf' called 'karaf_exec', which tries to use resource >> param values from the type in it's arguments... >> >> What I was aiming to achieve is that the command is executed by Puppet as >> a specified user, as defined on Line 24 of [4]. >> However as '@resource' is nil at the point of prefetch call, it's not >> working :( >> A sample log of a run is [5]. >> >> Now as I'm typing this, I'm thinking that trying to use values from a >> specific resource on a prefetch call possibly might not ever work... >> But how else could I model this scenario? Or is prefetching doomed to >> failure? >> >> Any help appreciated. >> >> Regards >> Gavin >> >> [1] https://github.com/fatmcgav/fatmcgav-karaf >> [2] >> https://github.com/fatmcgav/fatmcgav-karaf/blob/feature/prefetch_flush_providers/lib/puppet/type/karaf_feature.rb >> [3] >> https://github.com/fatmcgav/fatmcgav-karaf/blob/feature/prefetch_flush_providers/lib/puppet/provider/karaf_feature/karaf_feature.rb >> [4] >> https://github.com/fatmcgav/fatmcgav-karaf/blob/feature/prefetch_flush_providers/lib/puppet/provider/karaf.rb >> [5] https://gist.github.com/fatmcgav/ca147ef48ac726d1194f >> > -- You received this message because you are subscribed to the Google Groups "Puppet Users" 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-users/aff6987e-27d0-4f2b-8fcb-c52854168ac1%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
