On Apr 4, 3:07 pm, "Evan Hisey" <ehi...@gmail.com>
wrote:> The more I learn the less so things make sense. What exactly is the
> difference between including a class and inheriting a class? They seem
> to basicly provide the same function. I have looked over this in both
> James book and teh puppet website, but I am not getting any clearer on
> the difference and in fact may be getting less clear. OOP is not my
> forte.
You can only override parameters with inheritance. Consider the
following:
class parent {
file { "/tmp/file": ensure => present, mode => 0600, }
}
class child {
File["/tmp/file"] { mode => 755, }
}
include parent, child
Class child cannot override File["/tmp/file"]''s permissions
here.
Instead, do this (parent as above)
class child inherits parent {
File["/tmp/file"] { mode => 755, }
}
include child
Note parent does not need to be included, since it is inherited.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---