I''m currently using a "nagios" module that''s developed by an opensource community, and I''d like to hook some logic into a define to implement some kind of notion that''s really specific to the place I work. For now, I''ve been obligated to keep a modified version of the module, but that means I always need to rebase re-arrange my code around upstream modifications.. and for maintenance, it really adds a bunch of work. Do you guys know if it would be possible to implement a way to "hook" my extraneous logic into the define so that I don''t need to modify the module directly anymore? -- Gabriel Filion -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Gabriel, Could you get by with a wrapper? Say, a ''my_nagios'' define that does it''s own thing, then uses the third party ''nagios'' definition? You could add your own resources in your my_nagios that ''Subscribes'' to resources in the ''nagios'' define to insert your own resources into the dependency chain. If you actually need to modify parameters of a resource in a definition though then the only way I know of would be to have that parameter controlled by an argument to the defined type. On 12/04/12 07:10, Gabriel Filion wrote:> I''m currently using a "nagios" module that''s developed by an opensource > community, and I''d like to hook some logic into a define to implement > some kind of notion that''s really specific to the place I work. > > For now, I''ve been obligated to keep a modified version of the module, > but that means I always need to rebase re-arrange my code around > upstream modifications.. and for maintenance, it really adds a bunch of > work. > > Do you guys know if it would be possible to implement a way to "hook" my > extraneous logic into the define so that I don''t need to modify the > module directly anymore? >-- Luke Bigum Information Systems Ph: +44 (0) 20 3192 2520 luke.bigum@lmax.com | http://www.lmax.com LMAX, Yellow Building, 1A Nicholas Road, London W11 4AN FX and CFDs are leveraged products that can result in losses exceeding your deposit. They are not suitable for everyone so please ensure you fully understand the risks involved. The information in this email is not directed at residents of the United States of America or any other jurisdiction where trading in CFDs and/or FX is restricted or prohibited by local laws or regulations. The information in this email and any attachment is confidential and is intended only for the named recipient(s). The email may not be disclosed or used by any person other than the addressee, nor may it be copied in any way. If you are not the intended recipient please notify the sender immediately and delete any copies of this message. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden. LMAX operates a multilateral trading facility. Authorised and regulated by the Financial Services Authority (firm registration number 509778) and is registered in England and Wales (number 06505809). Our registered address is Yellow Building, 1A Nicholas Road, London, W11 4AN. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On 12-04-12 04:18 AM, Luke Bigum wrote:> Could you get by with a wrapper? Say, a ''my_nagios'' define that does > it''s own thing, then uses the third party ''nagios'' definition? > > You could add your own resources in your my_nagios that ''Subscribes'' to > resources in the ''nagios'' define to insert your own resources into the > dependency chain.Well, I''ve thought about that. But the problem with this approach is that all the nagios services defined in other modules to automatically verify services will not be using the ''my_nagios'' definition, but still the one from the nagios module.> If you actually need to modify parameters of a resource in a definition > though then the only way I know of would be to have that parameter > controlled by an argument to the defined type.yeah, hence the need to modify the define to add in the additional logic :\> On 12/04/12 07:10, Gabriel Filion wrote: >> I''m currently using a "nagios" module that''s developed by an opensource >> community, and I''d like to hook some logic into a define to implement >> some kind of notion that''s really specific to the place I work. >> >> For now, I''ve been obligated to keep a modified version of the module, >> but that means I always need to rebase re-arrange my code around >> upstream modifications.. and for maintenance, it really adds a bunch of >> work. >> >> Do you guys know if it would be possible to implement a way to "hook" my >> extraneous logic into the define so that I don''t need to modify the >> module directly anymore? >> > >-- Gabriel Filion -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On 12-04-12 04:18 AM, Luke Bigum wrote:> Could you get by with a wrapper? Say, a ''my_nagios'' define that does > it''s own thing, then uses the third party ''nagios'' definition? > > You could add your own resources in your my_nagios that ''Subscribes'' to > resources in the ''nagios'' define to insert your own resources into the > dependency chain.I''ve just thought about that: maybe I could get what I want by setting a default value to some parameters to the define? for example, if I''d like to define some groups depending on an arbitrary "level" of service : class level1_apache_server { Nagios::Service { base_groups => ''level1-apache-server'', } include apache_logic } I think I remember seeing discussion about this kind of feature getting killed sometime because of scoping issues.. is that right? -- Gabriel Filion -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On 12-04-12 02:10 AM, Gabriel Filion wrote:> Do you guys know if it would be possible to implement a way to "hook" my > extraneous logic into the define so that I don''t need to modify the > module directly anymore?oh, I think I''ve just found something that does pretty much exactly this: https://github.com/example42/puppet-openssh/blob/master/manifests/init.pp this class can include an arbitrary $my_class class to extend functionality. maybe I can do the same thing with an arbitrary define? I''ll try that out -- Gabriel Filion -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.