[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Speaking of imports...
From: |
Michael Grubb |
Subject: |
Speaking of imports... |
Date: |
Wed, 7 Dec 2005 12:25:27 -0600 |
I recently noticed something funny with imports.
The documentation says: "Note that, if you define variables in an
imported file they will not be defined for operations in their parent
files."
Which I take to mean that the following doesn't work as one might
expect:
cfagent.conf>
import:
any::
vars.cf
control:
any::
actionsequence = ( copy )
copy:
any::
$(cf_master_inputs) dest=$(cf_inputs) r=inf mode=644 server=$
(cf_policy_host)
vars.cf>
control:
any::
cf_master_inputs = (
/var/cfengine/masterfiles/inputs )
cf_inputs = ( /var/cfengine/inputs )
However, with update.conf, the rules in the copy stanza are
substituting the proper value of cf_master_inputs and cf_inputs.
However, the above example does not work with cfagent.conf, in order
for the above copy stanza to get the values of $(cf_master_inputs)
and $(cf_inputs) I have to put them in their own file and import them
after vars.cf, thus:
cfagent.conf>
import:
any::
vars.cf
copy.cf
control:
any::
actionsequence = ( copy )
copy.cf>
copy:
any::
$(cf_master_inputs) dest=$(cf_inputs) r=inf mode=644 server=$
(cf_policy_host)
works for what I'm intending.
My question is, is this a "bug" or am I missing something?
- Speaking of imports...,
Michael Grubb <=