[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: dynamis class creation
From: |
Jeremy Dreese |
Subject: |
Re: dynamis class creation |
Date: |
15 Jul 2002 14:23:36 -0400 |
I think there's a simpler way to do what you're trying to accomplish.
Cfengine has builtin classes (see
http://www.cfengine.org/docs/cfengine-Reference.html#Hard%20classes) to
detect the OS version. For example, on a Redhat 7.2 machine there is a
class called redhat_7_2 and on a Redhat 7.3 there is a class called
redhat_7_3. To get the listing of all the classes on a particular host,
just run "cfagent -p -v" as root. I use these classes to then do
different actions based on the OS version.
redhat_7_2::
do_one_thing
redhat_7_3::
do_another_thing
I guess this all assumes you're running cfengine 2.x. I hope this
helps!
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.
>
> Bob
> --
> ><> ><> ><> ><> ><> ><> ><> ><> ><> ><> ><> ><> ><>
> Bob Van Cleef, System Administrator (408) 734-8100
> MicroUnity, Inc. FAX (408) 734-8136
> 376 Martin Ave., Santa Clara, CA 95050 vancleef@microunity.com
>
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@gnu.org
> http://mail.gnu.org/mailman/listinfo/help-cfengine
--
-----------------------------------------
Jeremy Dreese
Engineering Computing Systems Integrator
College of Engineering
Bucknell University
voice: (570) 577-3714
fax: (570) 577-3579
email: jdreese@bucknell.edu