|
From: | Guolin Cheng |
Subject: | variables and classes definitions across imported files. |
Date: | Tue, 14 Sep 2004 16:01:11 -0700 |
Hi,
I’m still a newbie to fancy cfengine tool because I still have a lot questions. J I got problems to understand the definitions of variables and classes across imported sibling files.
My questions are listed below with difficulty from easy to difficult.
1, How many “actionsequence” variable can I defined in MAIN context?
From the advanced sample configuration files, normally one and only one is enough. I debugged with “-v –d2” and find all “control” sections from imported siblings files are aggregated together to make a big “control” section.
So, if several conflicting “actionsequence” are defined, they may conflict with each, or at least introduce undesirable consequences. Is that idea|guess correct?
2, variables seems can only defined in “groups” and “control” sections in each configuration file, is this accurate?
Variables defined in groups sections becomes “static” classes will be used later on.
Variables definitions in control sections for statement “AddInstallable” and “AddClasses” are turned into declared(AddInstallable) and defined(Addclasses) “dynamic” classes. Others are normal variables.
I tried to define variables in shellcommands section but it fails.
So, this means “groups” and “control” sections are special sections (maybe also “classes” I’ve not tried yet)? And variables definition can ONLY appear in these two types of sections?
3, For all imported sibling files, their same-named sections are merged|parsed into big sections before operations are carried out, is that correct for all or there are exceptions?
I tried to debug with “-v –d2” options, it seems that above guess is true. With some kind of glitches listed in question #4.
4, NORMAL variables defined in one imported file can be seen in its siblings, and vice versa, and that is not related to importing sequence in their common parent file. This is a normal feature or not?
5, What does the “global”, “update” and “main” contexts mean? And what and how is the inheritance relationship among them?
From the debugging output of cfagent, Does the output from the beginning to just before “* (Changing context state to: update) *” belong to GLOBAL context, output from here until “* (Changing context state to: main) *” are UPDATE context, Output from here to the end are MAIN context?
Or in another way: All work before parsing|carrying-out update.conf are GLOBAL section? parsing|carrying-out sections in update.conf are UPDATE context,
Parsing and carrying out sections in cfagent.conf (including imported files) are MAIN context?
Also, what’s the variables and classes inheritance relationship between these three contexts? Or there are no inheritance at all(seems this is right). For example, I have conflicting “actionsequence” statement in control section in update.conf and cfagent.conf, then which one will be in effect during parsing|carrying out actions in MAIN context?
Thanks a lot.
--Guolin
[Prev in Thread] | Current Thread | [Next in Thread] |