help-cfengine
[Top][All Lists]
Advanced

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

Re: ostype variable


From: Mark . Burgess
Subject: Re: ostype variable
Date: Wed, 4 Apr 2001 00:04:38 +0200 (MET DST)

On  3 Apr, 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




I guess $(class) or $(arch) are what you are looking for...see

http://www.iu.hio.no/cfengine/docs/cfengine-Tutorial.html#Variable%20substitution

best wishes,
Mark



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Work: +47 22453272            Email:  Mark.Burgess@iu.hio.no
Fax : +47 22453205            WWW  :  http://www.iu.hio.no/~mark
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





reply via email to

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