Hello again,
on the
http://reductivelabs.com/trac/puppet/wiki/CommonMisconceptions#class-inheritance-and-variable-scope
Page, the example is that:
#Ex:1
class one {
notice(" VAR IS: ${var})
}
class two {
$var = "test"
include one
}
should give me nothing in class "one" and "test" in class
"two".
This is ok so far.
Now I have stumbled upon the situation where I have something in the
line of:
#Ex:2
class zero {
notice ("This is class zero, and I do not care about
''var'' at all")
}
class one inherits zero {
notice(" VAR IS: ${var})
}
class two {
$var = "test"
include one
}
Now $var is not set in both: class one and two. The solution is of
course to have:
#Ex:3
class one {
include zero
notice(" VAR IS: ${var})
}
which is somewhat in sync with the documentation.
Anyway, I was wondering why Ex:2 does not work, since "class zero"
does not do anything with "class one", especially not with $var.
Somehow I would guess that inheriting a class does add "attributes" to
a class and not overwrite/delete "attributes" that the inheriting
class defines.
Can someone shed some light on this issue? I guess I misinterpret
inheritance in puppet.
Thanks,
udo.
--
:: udo waechter - root@zoide.net :: N 52º16''30.5" E
8º3''10.1"
:: genuine input for your ears: http://auriculabovinari.de
:: your eyes: http://ezag.zoide.net
:: your brain: http://zoide.net