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: Wed, 04 Apr 2001 15:31:38 +0200

Hi,

Here is what I get from my debian 2.2 cfengine
cfengine is
>cfengine -V
GNU cfengine-1.5.3
Free Software Foundation 1995, 1996, 1997
Donated by Mark Burgess, Centre of Science and Technology
Faculty of Engineering, Oslo College, 0254 Oslo, Norway
This program is covered by the GNU Public License and may be
copied free of charge.  No warranty is implied.

shellcommands:
        linux::
                "/bin/echo arch $(arch) class $(class)"


cfengine:host03:/bin/echo arch : arch 
linux_i686_2_2_17__1_Sun_Jun_25_09_24_41_EST_2000 class linux

>uname -a
Linux host03 2.2.17 #1 Sun Jun 25 09:24:41 EST 2000 i686 unknown

For my needs this arch feature provide a much too detailed directory tree.

Is there any possibility to have in cfengine a less detailed arch ?
Compilation options ?
It would be a good Idea to have a serie of "arch" variables like

arch1 = class = linux
arch2 = linux_i686
arch3 = linux_i686_2_2_17__1
arch4 = arch =  linux_i686_2_2_17__1_Sun_Jun_25_09_24_41_EST_2000

Thanks for all.
D.Germa

Mark.Burgess@iu.hio.no a écrit :

> 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
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@gnu.org
> http://mail.gnu.org/mailman/listinfo/help-cfengine




reply via email to

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