help-cfengine
[Top][All Lists]
Advanced

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

Re: hostname's hyphen character brings inconsistency in cfengine


From: Lyndon C. Lim
Subject: Re: hostname's hyphen character brings inconsistency in cfengine
Date: Fri, 3 Sep 2004 17:26:11 -0700

Hi.  I'd like to follow up on Guolin Cheng's observation.
I have experienced similar difficulties, and I am unable
to pin it down.  My only conclusion is to completely avoid
hyphens in host names.  I'm using v2.1.8


Here is my configuration file:

control:
    actionsequence = ( shellcommands )
    domain = ( artisan.com )
    addInstallable = ( Group1 Group2 )   # Don't think I need this
    group1 = ( l-eng-2447 )
    group2 = ( l_eng_2447 )
    ifElapsed      = ( 0 )

shellcommands:

l_eng_2447::
    "/bin/echo l_eng_2447, host names with underbar."

Group1::
    "/bin/echo Group1, group: host names with hyphen."

Group2::
    "/bin/echo Group2, group: host names underbar."

!Group1::
    "/bin/echo !Group1, negated group: host names with hyphen."

!Group2::
    "/bin/echo !Group2, negated group: host names with underbar."


Here are my results:

[root@l-eng-2447 tmp]# cfagent --file /nfs/cad-root/tmp/cfagent.conf -q
cfengine:l-eng-2447:/bin/echo l_eng: l_eng_2447, host names with underbar.
cfengine:l-eng-2447:/bin/echo !Grou: !Group1, negated group: host names with 
hyphen.
cfengine:l-eng-2447:/bin/echo !Grou: !Group2, negated group: host names with 
underbar.


> Hyphens cannot be used in class names, just as they cannot be used in
> variable names in any language I know of. Underscores can be used so you
> must have a different problem. I am guessing that your class definition
> is parsed after your rule to echo a string. 
> 
> This all works fine, it is used all the time for internal stuff.
> M
> 
> On  1 Sep, Guolin Cheng wrote:
> > Hi, 
> > 
> >   We got a problem to implement cfengine to hosts with hyphen
> > character(s) in their names like "ops-test2". According to our tests, we
> > can use either "ops-test2" or "ops_test2" in group|class definitions, or
> > take advantage of group definitions in NIS netgroup map in cf.groups
> > file.  But if we directly use hostnames to work as class names in
> > cf.main, we find that "ops-test2" class will fails, while "ops_test2"
> > class works fine.


-- 
Lyndon C. Lim;  lyndon@artisan.com;  408.734.5600;  408.734.5050 (fax)
Artisan Components; 141 Caspian Court; Sunnyvale, CA 94089-1013; USA



reply via email to

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