[Top][All Lists]

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

macros from modules set too late?

From: Martin Andrews
Subject: macros from modules set too late?
Date: Thu, 31 Jan 2002 20:40:07 -0500

I am trying to use a module to define macro values in cfengine-2.0.a16 and I 
cannot get them to take affect.

Here is an example config:
    actionsequence = ( module:environ copy )
#    HOST_SHORT = ( tbd )
#    HOST_SHORT = ( foo )
    moduledirectory = ( "$(CFINPUTS)/scripts" )
    domain = ( )

    /bin/sh dest=/tmp/$(HOST_SHORT)

Here is the module:
echo "=HOST_SHORT=`hostname | sed 's/\..*//'`"

Running cfagent I get:

    cfengine: Need to link files /tmp/${HOST_SHORT} -> ./bash

If I uncomment the hardcoded values for HOST_SHORT I get:

    cfengine:dhcp8::17: Warning: Redefinition of macro HOST_SHORT=dhcp8
    cfengine: Need to link files /tmp/foo -> ./bash

So it appears that the module is processed and the macro is set before the 
copy is performed, but the the variable was expanded as some prior phase. Any 
ideas? Am I doing something wrong?


Martin Andrews

reply via email to

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