help-cfengine
[Top][All Lists]
Advanced

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

Transforming a variable into a group list specification


From: GERMA Denis
Subject: Transforming a variable into a group list specification
Date: Thu, 29 Mar 2001 18:34:47 +0200

Hi,

I need to define a variable that an be used in clients rules do generate
some config files.
I need a class to define the server rules.

1- A first way to do this is to define the variable in the control
section,
and to define the class server in the groups section.

This force us to manage 2 lists which shall be equal.

2- I found a second way of doing this is to define a variable and to
reuse
this information to define the class.

But I did not found any syntaxe to express this directly in cfengine.

I found the following way.
Does anybody knows a better solution ?


control:

        linux::
                actionsequence =
                        (
                                shellcommands
                        )

                domain  = ( mydomain )

        server_list = ( "host1  host2" )

groups:

                server = ( '/bin/bash -c "set -x ; for i in
$(server_list) ; do if [ $i = $(host) ] ; then exit 0 ; fi ; done ; exit
1 ;"' )


shellcommands:
        linux.server::
                "/bin/echo I am in the list $(server_list)"



Thank for all.
D.Germa




reply via email to

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