I''m fairly certain I encountered the preferred pattern for inheriting from a class for the specific purpose of disabling it. I can''t seem to find it anymore. Any pointers? A specific example would be our ldapauth module. The main class installs a few packages and files in order to activate LDAP auth. This class is be included by default in all nodes. I would like to have an ldapauth::disabled that can be added to a node to prevent realization of this class. Thanks! -Ben --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
class x inherits y { Resource["name"] { parameter => "newvalue" } } http://reductivelabs.com/trac/puppet/wiki/LanguageTutorial#id6 Regards, AJ On 7/01/09 3:18 PM, "Ben Beuchler" <insyte@gmail.com> wrote:> > I''m fairly certain I encountered the preferred pattern for inheriting > from a class for the specific purpose of disabling it. I can''t seem > to find it anymore. Any pointers? > > A specific example would be our ldapauth module. The main class > installs a few packages and files in order to activate LDAP auth. > This class is be included by default in all nodes. I would like to > have an ldapauth::disabled that can be added to a node to prevent > realization of this class. > > Thanks! > > -Ben > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Ben Beuchler wrote:> I''m fairly certain I encountered the preferred pattern for inheriting > from a class for the specific purpose of disabling it. I can''t seem > to find it anymore. Any pointers?The ones I use are a bit different than AJ''s, and don''t really use inheritance. Don''t know if I saw this elsewhere first, but if a disabling class is supposed to override everything that the enabling class did, then I''m not sure if inheritance does anything for you. Example: class pgicdk { package { [ "pgicdk" ]: ensure => latest, } file { "/etc/bash.bashrc.d/pgicdk.sh": source => "puppet:///pgicdk/pgicdk-$architecture.sh", owner => root, group => root, mode => 0644; } file { "/opt/pgi/license.dat": source => "puppet:///pgicdk/license.dat", owner => root, group => root, require => Package["pgicdk"], mode => 0644; } } class pgicdk::disabled { package { [ "pgicdk" ]: ensure => absent, require => File["/opt/pgi/license.dat"], } file { "/etc/bash.bashrc.d/pgicdk.sh": ensure => absent, } file { "/opt/pgi/license.dat": ensure => absent, } } -- Mike Renfro / R&D Engineer, Center for Manufacturing Research, 931 372-3601 / Tennessee Technological University -- renfro@tntech.edu --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---