Hello,
I am currently experiencing a bit of a quandry with how to specify default
configuration applications to generic nodes.
Here is an example setup:
Classes:
Class A
Class B inherits Class A
Class C inherits Class B
Problem:
I have unique hosts (nodes) X and Y and a bunch of other standard hosts. I
would like X and Y to be able to override attributes in Class C (thus inherit
class C) but I want the rest of the hosts to apply the configuration in Class C
without custom configuration and without having to be individually specified.
For example:
Class X inherits C { ... }
Node X { include X }
Class Y inherits C { ... }
Node Y { include Y }
generic_nodes { include C }
Unfortunately, I have been unable to determine how to approach this problem
properly.
My first thought was something like the following:
case $hostname {
X: { node X { include X }; }
Y: { node Y { include Y }; }
default: { include C }
}
But, I haven''t been able to correctly generate the syntax for some
reason.
Any assistance would be appreciated.
Thank you,
-- Rob --
____________________________________________________________________________________
Now that''s room service! Choose from over 150,000 hotels
in 45,000 destinations on Yahoo! Travel to find your fit.
http://farechase.yahoo.com/promo-generic-14795097
_______________________________________________
Puppet-users mailing list
Puppet-users@madstop.com
https://mail.madstop.com/mailman/listinfo/puppet-users
--On Thursday, February 22, 2007 11:37 AM -0800 Robert Mombro
<j8irfm@yahoo.com> wrote:
Class X inherits C { ... }
Node X { include X }
Class Y inherits C { ... }
Node Y { include Y }
node default {
include C
}
--
Digant C Kasundra
// www.diggyk.com //
Mr. Kasundra,
So, you are saying that entering
node default { include C }
will work for all unnamed nodes?
In other words, I can have:
node bob inherits bob {}
node jim inherits jim {}
and
node default { include default }
and all nodes that are not bob or jim will get this configuration?
Thank you,
-- Rob --
----- Original Message ----
From: Digant C Kasundra <digant@stanford.edu>
To: Puppet User Discussion <puppet-users@madstop.com>
Sent: Thursday, February 22, 2007 2:44:44 PM
Subject: Re: [Puppet-users] Assistance Requested
--On Thursday, February 22, 2007 11:37 AM -0800 Robert Mombro
<j8irfm@yahoo.com> wrote:
Class X inherits C { ... }
Node X { include X }
Class Y inherits C { ... }
Node Y { include Y }
node default {
include C
}
--
Digant C Kasundra
// www.diggyk.com //
_______________________________________________
Puppet-users mailing list
Puppet-users@madstop.com
https://mail.madstop.com/mailman/listinfo/puppet-users
____________________________________________________________________________________
Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews at Yahoo! Games.
http://videogames.yahoo.com/platform?platform=120121
_______________________________________________
Puppet-users mailing list
Puppet-users@madstop.com
https://mail.madstop.com/mailman/listinfo/puppet-users
On Thu, 2007-02-22 at 14:26 -0800, Robert Mombro wrote:> Mr. Kasundra, > > So, you are saying that entering > > node default { include C } > > will work for all unnamed nodes?Yes, that specifies the config for nodes not otherwise mentioned in the manifest.> In other words, I can have: > > node bob inherits bob {} > node jim inherits jim {}AFAIK, nodes can''t inherit from classes; you want something like node bob { include bob } David
> > Mr. Kasundra, > > So, you are saying that entering > > node default { include C } > > will work for all unnamed nodes? > > In other words, I can have: > > node bob inherits bob {} > node jim inherits jim {} > > and > > node default { include default } > > and all nodes that are not bob or jim will get this configuration? > > Thank you, > > -- Rob -- >Yup, but as David pointed out, you want to use include, not inherits because nodes cannot inherit from classes. So something like: class Person { ... } class Bob inherits Person { ... } class Jim inherits Person { ... } node bob { include Bob } node jim { include Jim } node default { include Person } -- Digant C Kasundra // www.diggyk.com //