Hi Bas,

Bas van der Vlies wrote:
> First lets start with a suggestion. there a lot function that return a 
> class, mabye a new function:
>    - LISA_CLUSTER expression => getenv_class("LISA");
> 
> Which set the class LISA_CLUSTER if the variable is defined. We now use 
> getenv and strcmp to do this

We'll think about this.

> I am reading a lot of documentation but i am a bit lost. You must read 
> carefully what is for the community edition and what is for the other 
> versions. I find this a bit confusing. Baer in mind i must get acquainted 
> with the new syntax.

Thanks, we are planning to make this clearer. In general, if it doesn't say 
"Nova only" it
is available in Community. Note that the default docs are the bleeding edge, so 
you might
have to compile from svn to get all the functions.

> I am trying to switch from cfengine2 to cfengine3. We make use of the 
> PrepModule to set some useful GLOBAL classes with the aid of a script. Just 
> print/echo +<class> to stdout. Can this be accomplished with cfengine3.

There is a use-module function, but you can also embed modules simply as 
commands:
promises in Cfengine 3. Since there is no actionsequence, only a bundle 
sequence you can
just arrange to place a module probe into a bundle/method early on.

> I am using cfengine community edition 3.0.4 and i get this error/warning. 
> But the class can not be true, because the environent variable is set.
> {{{
>   !! Redefinition of a constant variable "CLUSTER"
> Promise (version 1.0.1) belongs to bundle 'g' in file 
> '/var/lib/cfengine3/inputs/promises.cf' near line 51
>   !! Redefinition of a constant variable "cluster_file"
> Promise (version 1.0.1) belongs to bundle 'g' in file 
> '/var/lib/cfengine3/inputs/promises.cf' near line 52
> }}}
> 
> the promises.cf file:
> {{{
> bundle common g
> {
> vars:
>       "lisa" string => getenv("LISA_CLUSTER","1");
> 
>       LISA_CLUSTER::
>                  "CLUSTER" string => "LISA";
>                  "cluster_file" string => "lisa.cf";
>          !LISA_CLUSTER::
>                  "CLUSTER" string => "NOT LISA";
>                  "cluster_file" string => "common.cf";
> 
> 
> classes:
>       "LISA_CLUSTER" expression => strcmp("$(lisa)","1");
> }
> 
> This is due the fact that vars is evaluated sooner the class is set. What i 
> want is to import files based on a class that is not known. Or is there a 
> better syntax for cf3 that i did not find.
> 

This should sort itself out. Make sure you are using a recent version, or wait 
for the
3.0.5 release next week.

-- 
Mark Burgess

-------------------------------------------------
Professor of Network and System Administration
Oslo University College, Norway

Personal Web: http://www.iu.hio.no/~mark
Office Telf : +47 22453272
-------------------------------------------------
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to