bug-cfengine
[Top][All Lists]
Advanced

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

bugreport: module generated macros not evaluated


From: Thomas . Lemm
Subject: bugreport: module generated macros not evaluated
Date: Mon, 9 Sep 2002 11:41:29 +0200 (MEST)

Hi all!

I have experienced problems with cfengine (1.6.3 and 2.0.4) and module
generated macros (=variables). If you have 
1) a main cfengine file which defines variables via a module
2) a sub cfengine file included by the main cfengine file
3) a copy statement in the sub cfengine file
the cfengine (=cfagent) program will not recognize the module generated
variable as valid.

As an example I have boiled down the problem to a simple test case. (See
below for snipplets of the file) You will receive an error stating missing
absolute paths when using this setup. But if you change "dir3"->"dir2" in the 
copy
statement of file rtest1.cfengine, everything will work out ok. This is
peculiar, since variable "dir2" was defined in the cfengine program (which works
out well) while dir3 was defined via incorporating the module (which will
then produce an error when being used).

This is the module program
--- file module:dir3 ---
#!/bin/sh

echo =dir3=/tmp/p3
--- end ------------------

This is the main cfengine file: (please adapt the moduledirectory)
--- file test1.cfengine ----
#!/usr/sbin/cfengine -f
#
#
control:
                dir1    = ( "/tmp/p1" )
                dir2    = ( "/tmp/p2" )
                moduledirectory = ( /home/lemm/cfengine/test1 )
                actionsequence = (
                        module:dir3
                        directories
                        copy
                        shellcommands
                        )
import:
                rtest1.cfengine

directories:

                $(dir1)
                $(dir2)

shellcommands:
                "/bin/echo $(dir1)"
                "/bin/echo $(dir2)"
                "/bin/echo $(dir3)"

#
# end of file
#
--- end --------------------------------

This is the imported sub- cfengine file

--- file rtest1.cfengine ----------------
#!/usr/sbin/cfengine -f
#
#
control:
                actionsequence = (
                        copy
                        )

copy:
                $(dir1)
                        dest=$(dir3)
                        recurse=inf


#
# end of file
#
--- end ----------------------------------------------

-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net





reply via email to

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