Forum: Cfengine Help Subject: Re: Accessing variables declared within cf3 modules Author: mikec Link to topic: https://cfengine.com/forum/read.php?3,18279,18294#msg-18294
The manual *does* say that to access variables that aren't in a global (common) scope need to be qualified: http://www.cfengine.org/manuals/cf3-3.0.4.html#Variable-expansion-in-cfengine-3 and repeats this in other places, e.g. http://www.cfengine.org/manuals/cf3-3.0.4.html#site_002ecf http://www.cfengine.org/manuals/cf3-3.0.4.html#expand_005fscalars-in-insert_005flines Granted, it doesn't explicitly say "this also applies to modules", however I think it's fair to point out that the manual does say: Modules define variables in cf-agent by outputting strings of the form =variablename=value These variables end up in a context which has the same name as the module. When the $(allclasses) variable becomes too large to manipulate conveniently, you can access the complete list of currently defined classes in the file /var/cfengine/state/allclasses. (my emphasis). In this case, the information is there, it's in an obvious place, and it's accurate. I definitely agree that the manual has some shortcomings, but not this time. Cheers Mike _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine