help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ostype variable


From: Germa Denis
Subject: Re: ostype variable
Date: Tue, 03 Apr 2001 19:27:50 +0200

Hi all,

I have the same pb, and others similar  :

The general issue seems to be :
How could we transforme classes/groups in variable 
or variables in classes/groups,
or define the classes/groups and variable from an external source
consistently.

My impression is either 
I have not understand something fondamental in cfengine 
or I missed some feature which makes one of those opperations easy
or there are somme feature missing. 

My issues are :

1- Managing ntp servers and clients :
The clients needs the list for the ntp servers to build configuration
files (variable).
The servers needs to know they are servers to ru the daemons (class).
The two lists needs to be consistent.

I found a partial solution 
(See my previous mail : Transforming a variable into a group list
specification)
But nobody answered my question yet.

2- The way I found for your issue was a silly work around :

Example for the Os version :
        linux_2_3_99_pre5::
                system_release = ( '2.3.99-pre5' )
        
        linux_2_0_34::
                system_release = ( '2.0.34' )
        
.....

3- Same Pb for the distribution version (Linux Debian) the same solution
for me :

First get the debian classe 

groups:
top_debian_2_0 = ( '/bin/grep -q "2.0" /etc/debian_version'  )

then define variables from the classe definition.

Thanks for all.
D.Germa

                

Patrice GUERLAIS wrote:
> 
> Hi all,
> 
> I know how to do an 'if' within a cfengine script, using classes, for example 
> using os type classes (redhat, solaris, debian, ...).
> But is there a variable containing the os type value ? something which could 
> be used like in :
> 
> <cut>
> copy:
> ${source_dir}/${OSTYPE_CFENGINE_INTERNAL_VARIABLE}
>         dest=${dest_dir}
>         ...
> </cut>
> 
> With such a variable, I can deal with a set of files structured with a 
> sub-dir for each OS I use and avoid writing things like the
> following, for which I must add the new files in the tree _and_ modify the 
> script each time I use a new OS.
> <cut>
> # Give a value to an ostype variable
> redhat::
>         ostype = ( redhat )
> solaris::
>         ostype = ( solaris )
> ...
> 
> # and now use that variable
> copy:
>         ${source_dir}/${ostype}
>                 dest=${dest_dir}
>                 ...
> </cut>
> 
> Thanks for your help
> 
> Patrice
> 
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@gnu.org
> http://mail.gnu.org/mailman/listinfo/help-cfengine

-- 
Merci d'avance
=====================================================================
  ////        Denis Germa
//     ////   CS TELECOM
///  //       4 Av. du General Leclerc 92263 Fontenay aux roses cedex
      //      Phone : 01 41 87 74 05       Fax  : 01 41 87 74 27
  /////       Email : denis.germa@cstelecom.com
=====================================================================



reply via email to

[Prev in Thread] Current Thread [Next in Thread]