[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: dynamis class creation
From: |
Vilius Puidokas |
Subject: |
Re: dynamis class creation |
Date: |
Mon, 15 Jul 2002 15:23:48 -0400 (EDT) |
what about using cfengine's logic for classes, like:
RH72 = ( "/bin/grep 7.2 /etc/redhat-release" )
amd = ( "/bin/grep amd /etc/whatever-amd-file" )
RH = ( RH1 RH62 RH72 )
RH::
do whats common for all RH boxes
RH.!amd-very-specific::
except amd-very-specific boxes which conflict with RH standarts and
shouldnt be really called RH :)
RH.amd-mod::
do whats common for all amd stuff
RH.amd-very-specific::
do something very special
v
On Mon, 15 Jul 2002, Bob Van Cleef wrote:
>
> On 15 Jul 2002, Jacob Lee wrote:
>
> > On my systems, redhat_7 and redhat_7_1 (or redhat_7_0, etc.) are both
> > defined as hard classes. Check for that. If it does turn out that you
> > need to define a class based on the output of a shell script,
> > investigate the cfengine module capabilities:
>
> Sigh... I guess I need to upgrade to 2.x IFF it will report OS level
> on the 6.x systems. What I have now works, except for this one function,
> which does appear to exist in 2.x either. I hate upgrading working
> systems. /sigh.
>
> > http://www.cfengine.org/modules/
>
> That seems to be a rather complex way to achieve a simple option.
>
> I am actually surprised that there appears to be no way to do this.
>
> I have a couple of other things where being able to define a class
> on the fly would have dramatically cut the number of lines in the
> cfengine configuration script.
>
> Bob
>
> > On Mon, 2002-07-15 at 14:02, Bob Van Cleef wrote:
> > >
> > > This has got to be an FAQ, but I can't find it anywhere.
> > >
> > > I want to define a custom class based on the level of OS. So,
> > > I wrote a simple little script that checks /etc/redhat-release
> > > and returns rh60 for red hat 6.0 and rh6.2 for red hat 6.2
> > > systems, etc. Now, the question is, "How to use that script to
> > > define a corresponding class?
> > >
> > > It appears that can create a separate line for each class:
> > > rh60 = ( "script that returns non-null only on 6.0 system" )
> > > rh62 = ( "script that returns non-null only on 6.2 system" )
> > > which seems counter intuitive.
> > >
> > > but there does not appear to be a method for having a script
> > > that returns the name of the class that you want to define.
> > >
> > > define = ( "script returns name of class that is defined )
> > >
> > > There are enough differences between various versions of Red Hat that
> > > this has become critical. (Three different "amd" configuration files
> > > for one example.) The standard classes include the kernel level, but
> > > not the OS distribution level.
> >
> >
>
>