Forum: Cfengine Help
Subject: Re: Redefinition of variable despite class qualification
Author: jonb1987
Link to topic: https://cfengine.com/forum/read.php?3,22392,22394#msg-22394

The "server" class does NOT get redefined elsewhere.

However, it is worth describing the system a little more. What is clear to me 
is I am lacking some understanding in how the cfengine actually operates!
Here are some observations:


[*] I get these errors when I manually run cf-promises
[*] I do NOT get these errors when I manually run cf-agent
[*] I DO get these errors when I run cf-execd -F via my cron script.


But why does cf-execd run cf-promises? My promises.cf has the following...

body executor control
{
splaytime    => "2";
exec_command => "$(sys.workdir)/bin/cf-agent -f failsafe.cf && 
$(sys.workdir)/bin/cf-agent";
}


Looking at the output of cf-promises, it seems that the errors are reported 
during initial parsing of the files (which is I guess what cf-promises is for).

As background info, here's some more on these particular classes which are 
flagged as redefinitions...

[*] in the "vars" section of my common bundle (g), I set some variables
[*] the class "server" is set in this common bundle (g) based on the variable
[*] in a bundle executed LATER (cfengine), variables are set based on the class 
"server"

Now I know in the documentation there is a vague statement about class-variable 
dependencies...
"If you set variables based on classes that are determined by variables, in a 
complex dependency chain, then you introduce an order dependence to the 
resolution that might be non-unique. Since Cfengine starts trying to converge 
values as soon as possible, it is best to define variables in bundles before 
using them, i.e. as early as possible in your configuration. In general it is 
wise to avoid class-variable dependency as much as possible. "

Any help is much appreciated.

But I think my settings are legal and secure from my ordering specs and 
knowledge.

So all in all, 

[*] this appears to be a cf-promises problem only
[*] I don't know why cf-promises is called at all
[*] I don't know how to eliminate the errors


_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to