> This does indeed make sense and yes, you will need to 'inherit' the
> default node to have other nodes apply the settings.
well actually you have to inherit the unix class, that you overwrite the
parameters.
Pay attention to the fact that inheritance in nodes is slightly
different than in classes. The Best thing imho is to build such
inheritance in the classes itself and leave any inheritance out of the
node definitions.
cheers pete
> Does the default node apply to all nodes, including those with their
> own node entry or only nodes without an explicit node entry? That is,
> will I need to make the "freebsd-box" explicitly inherit the "default"
> node?
>
The answer as stated in
http://reductivelabs.com/trac/puppet/wiki/LanguageTutorial#nodes, is
that the default node is used when there is _no_ other matching node.
Evan
Can you explain that in a bit more detail?
-Robin
--
They say: "The first AIs will be built by the military as weapons."
And I'm thinking: "Does it even occur to you to try for something
other than the default outcome?" -- http://shorl.com/tydruhedufogre
http://www.digitalkingdom.org/~rlpowell/ *** http://www.lojban.org/
>> Pay attention to the fact that inheritance in nodes is slightly
>> different than in classes. The Best thing imho is to build such
>> inheritance in the classes itself and leave any inheritance out of
>> the node definitions.
>
> Can you explain that in a bit more detail?
Some of that I explained in these 2 mails:
http://markmail.org/message/ivwno5cpaouavgsu
http://markmail.org/message/ls2bxc7yqwre564s
however, I thought that I explained in another thread it more in a
detail, but I can't find it anymore.
If you have further questions, don't hesitate to ask.
cheers pete
> So the way I have implemented it is that we have a basenode node with the
> common elements that all nodes get. The basenode is then inherited by each
> of the specific nodes, therefore you get something like:
>
> import "foo"
> import "httpd"
>
> node basenode {
> include foo
> }
>
> node webnode inherits basenode {
> include httpd
> }
>
> node www1.example.com inherits webnode {}
> node www2.example.com inherits webnode {}
>
>
> Does that make sense?
yeah that will work. However sooner or later you will get one problem here:
if you use in the class httpd a variable which should be defined in the
node and you will define this variable in the definition of
www1.example.com, this variable will always be empty, as the class gets
evaluated before the variable is set in the subnode of the webnode.
So something like that, will give you problems:
node webnode inherits basenode {
include httpd
}
node www1.example.com inherits webnode {
# i'm used in the class httpd
$httpd_server_name = $fqdn
}
this is how inheritance works for nodes and which "confuses" a lot of
people. Therefore imho the best thing is to do inheritance in a bunch of
config-classes and using nodes only to set variables and include the
config class in every node _after_ setting all the variables. Or
switching over to external nodes, which will give you a lot more
flexibility than the site.pp file.
cheers pete