From the reference guide:
"Note that, if you define variables in an imported file they will not
be defined for operations in their parent files. This because cfengine
reads in all the import files after the main file has been parsed—not
at the place where you call import in your script. This means that
variables or macros defined in imported files are only defined after
the main program. Variables from earlier files are inherited by later
includes, but not vice-versa."
The experiment:
[EMAIL PROTECTED]:~/.cfagent/inputs$ tail cf.import cf.value ==>
cf.import <==
shellcommands:
"/bin/echo cf.import ${variable}"
"/bin/echo cf.import ${variable2}"
import:
cf.value
==> cf.value <==
control:
variable = ( "value" )
shellcommands:
"/bin/echo cf.value ${variable}"
[EMAIL PROTECTED]:~/.cfagent/inputs$ CFINPUTS=~/.cfagent/inputs/
cfagent -f ./cf.import -K
cfengine::/bin/echo cf.im: cf.import value
cfengine::/bin/echo cf.im: cf.import value value2
cfengine::/bin/echo cf.va: cf.value value
It appears that the macro are now expanded during the execution of an
action? If so does any part of the documentation I quoted above
apply? What am I am missing?
--
Christian Pearce
Perfect Order, Inc.
_______________________________________________
Help-cfengine mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-cfengine