Forum: CFEngine Help
Subject: Re: Explanation for 3x iteration in a bundle
Author: frans
Link to topic: https://cfengine.com/forum/read.php?3,24402,24410#msg-24410
Beto -
I didn't see any "commands:" section in your bundle.. but I think I've figured
out what's going on. As verbose output indicates, variable convergence happens
just once at the execution of cf-agent and is not revisited regardless of what
classes change during actual bundle execution.
Other parts of a bundle DO get processed three times.
This bundle works fine:
bundle agent test {
files:
red::
"/tmp/foo/red"
copy_from => local_cp("/root/red"),
classes => if_repaired("$(myslist)");
commands:
"/root/setredclass.sh"
module => "true";
}
The "/tmp/foo/red" promise is skipped over the first time but on the second
loop through the bundle it does get copied into place.
This bundle, however, does not work the same way.
bundle agent test {
vars:
red::
"redvar" string => "redvar";
commands:
"/root/setredclass.sh"
module => "true";
reports:
red::
"$(redvar) is set.";
}
The report only ever shows "$(redvar)"
If I'm right then this is a subtlety to cfengine that might warrant a sentence
or two extra in the discussion of normal ordering... even though I appear to be
the only person to have stubbed my toe on this behaviour. :)
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine