Le 11/06/2015 à 06:13:29-0700, jcbollinger a écrit > > > On Wednesday, June 10, 2015 at 5:05:00 PM UTC-5, Albert Shih wrote: > > Hi, > > I would like to known if it's possible to extend a module without touching > the module. > > I mean let's take sample : > > If I want use > > apache (from puppetlabs) > > but each time I create a vhost with > > apache::vhost { 'thing' : } > > i want also add a nagios check on my nagios server. >
Thanks everybody for your answer. > > > No, Puppet DSL has no facility for monkey-patching modules, nor any callback That's too bad... > mechanism that could be used to dynamically detect declarations of particular > classes or resource types. As others have recommended, the way to approach > this is to wrap classes and resources. There are various ways to structure > the > details, but I, too, suggest having a look at roles & profiles. Well I just did, so maybe I'm not understand what exactly are roles & profiles, but I'm not fully convince. If I stick with my example of apache::vhost if I create a profile like define profile::myapachevhost ( <-- class don't do it because we can have many vhost $vhostname='my_super_website') <-- or from hiera { include ::apache apache::vhost { ${vhostname} } add_to_my_nagios_this_vhost {${vhostname}} } it should work. But how can I have all params in that profile ? Of course I can use hiera but the problem is still the same. Other example, if on some host I just want check through nagios the vhost answer, but on other I want to check the server answer with a regexp, I need to add a parameters to my profile. I'm going to end up with both all params of apache::vhost and add_to_my_nagios_this_vhost params. I agree with you apache is a little special because they got lots of params, but we use apache a lots too. Regards. -- Albert SHIH Heure local/Local time: jeu 11 jui 2015 21:58:54 CEST -- 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 puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/20150611201308.GA67815%40pcjas.obspm.fr. For more options, visit https://groups.google.com/d/optout.