Forum: CFEngine Help
Subject: Re: cf_promises_validated : bug 1258
Author: davidlee
Link to topic: https://cfengine.com/forum/read.php?3,27307,27591#msg-27591

Thanks for the reply, Nick.  Much appreciated.

By far the major problem seems to be a complete lack of any formal 
documentation.  Your reply above is helpful, as is Eynstein's blog entry.  But 
we could really, really benefit from some sort of brief but officially provided 
description of how this is supposed to work (including "am_policy_hub"; see 
later).

So, please, if any of the developers is reading this, could we have some 
documentation about this?  Please?

That said, I may be getting there.

Firstly can I check that I understand your description of 
"cf_promises_validated" above?  Assume "failsafe.cf" is as distributed at, say, 
3.3.4 (community edition).

(1) Within any machine, is the copy in "inputs" (i.e. 
"inputs/cf_promises_validated") used at all?  I suspect not.

(2) On the central hub, is the copy in "masterfiles" (i.e. 
"masterfiles/cf_promises_validated") magically maintained within cfengine 
itself (some black magic deep within the source code, rather than a 
user-visible ".cf" file)?  Minor supplementary question: how might this extend 
to slave hubs?

(3) On any non-hub (simple client) machine, is the copy that ends up in 
"masterfiles" (i.e. "masterfiles/cf_promises_validated") ultimately copied in 
from a hub?

I think I see what might be happening in my case.  I suspect it might be 
related to a mysterious, and similarly almost completely undocumented, thing 
called "am_policy_hub".

This  "am_policy_hub" seems to be some sort of pre-defined class, used by 
"failsafe.cf".  Envisage a simple cluster of two machines, one where policy is 
maintained, the other a pure client.  I presume the former should be routinely 
running with "am_policy_hub" set and the latter with it unset.  But how is this 
set/unset nature actually defined?

I suspect that my policy hub is, for some reason, is running with 
"am_policy_hub" unset instead of set.   (I have just done a quick check by 
putting a temporary "reports:" section into one of our ".cf" files to tell me; 
both a client and a (supposed-to-be) hub reports they are not hubs.)

What is the cleanest way to fix this (presumably so  that "am_policy_hub" is 
appropriately set/unset on hub/client)?



By the way, there are at least two improvements that could be made to the 
contents of "cf_promises_validated".  Indeed, one of them may even classify as 
a bugfix.

(1)  The contents (a single line datestamp) lack a trailing newline.  This is 
an irritating (but admittedly minor) annoyance when "cat"ing the file to look 
at it.

(2)  It lacks a timezone.   Won't this be troublesome (i.e. buggy):
  (i) when Daylight Savings changes occur;
  (ii) for sites/organisations that span multiple timezones (policy hub in one 
TZ; clients in another)?

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

Reply via email to