Forum: CFEngine Help
Subject: cf_promises_validated and $(master_location)
Author: Tim
Link to topic: https://cfengine.com/forum/read.php?3,26327,26327#msg-26327

Greetings,

Using Cfengine-3.3.3, I am working on setting up separate masterfiles locations 
for development and production environments:

/var/cfengine/masterfiles-dev
/var/cfengine/masterfiles-prod

Starting with masterfiles-dev/, I have copied over failsafe.cf, promises.cf, 
and cfengine_stdlib.cf from /var/cfengine/share/CoreBase/.

In failsafe.cf, I've added the following classes:

   "realm_dev" expression => fileexists( "/DevelopmentFlagFile" );
   "realm_prod" expression => fileexists( "/ProductionFlagFile" );

and the following vars:

   realm_prod::
     "master_location" string => "/var/cfengine/masterfiles-prod",
                       comment => "The master cfengine policy directory on the 
policy host",
                        handle => "update_vars_master_location";

   realm_dev::
     "master_location" string => "/var/cfengine/masterfiles-dev",
                       comment => "The master cfengine policy directory on the 
policy host",
                        handle => "update_vars_master_location";

This seems to be mostly working, with the exception of cf_promises_validated. 
This file continues to be created under 
/var/cfengine/masterfiles/cf_promises_validated, yet cf-agent wants to copy it 
down from /var/cfengine/masterfiles-dev/cf_promises_validated:

# ls -ld masterfiles/cf_promises_validated masterfiles-dev/cf_promises_validated
ls: masterfiles-dev/cf_promises_validated: No such file or directory
-rw------- 1 root root 24 Jun 26 11:44 masterfiles/cf_promises_validated

# /var/cfengine/bin/cf-agent -f /var/cfengine/inputs/failsafe.cf -vn
cf3> Initiate variable convergence...
cf3>
cf3>      +  Private classes augmented:
cf3>      +       files_ok
cf3>      +       have_ppkeys
cf3>      +       realm_dev
cf3>
cf3>      -  Private classes diminished:
cf3>
cf3>
cf3>
cf3>    =========================================================
cf3>    files in bundle update (1)
cf3>    =========================================================
cf3>
cf3>
cf3>     .........................................................
cf3>     Promise's handle: check_valid_update
cf3>     Promise made by: "/var/cfengine/inputs/cf_promises_validated"
cf3>
cf3>     Comment:  Check whether a validation stamp is available for a new 
policy update to reduce the distributed load
cf3>     .........................................................
cf3>
cf3>  -> Copy file /var/cfengine/inputs/cf_promises_validated from 
/var/cfengine/masterfiles-dev/cf_promises_validated check
cf3> No existing connection to 192.168.X.XX is established...
cf3> Set cfengine port number to 5308 = 5308
cf3> Set connection timeout to 10
cf3>  -> Connect to 192.168.X.XX = 192.168.X.XX on port 5308
cf3> skipidentify was promised, so we are trusting and simply announcing the 
identity as (xxxxx.xx.xxx) for this host
cf3> .....................[.h.a.i.l.].................................
cf3> Strong authentication of server=192.168.X.XX connection confirmed
cf3>  -> Public key identity of host "192.168.X.XX" is 
"MD5=XXXXXXXXXXXXXXXXXXXXXXXXXXXX"
cf3> Server returned error:  Unspecified server refusal (see verbose server 
output)
cf3> Can't stat /var/cfengine/masterfiles-dev/cf_promises_validated in 
files.copyfrom promise
cf3> Existing connection just became free...
cf3>
cf3> . . . . . . . . . . . . . . . . . . . . . . . . . . . .
cf3> Skipping whole next promise (/var/cfengine/inputs), as context 
am_policy_hub|validated_updates_ready is not relevant
cf3> . . . . . . . . . . . . . . . . . . . . . . . . . . . .


Is it correct that I should be expecting to see cf_promises_validated created 
under $(master_location) = /var/cfengine/masterfiles-dev ?   And if so, is 
there a configuration directive or other method to accomplish this, that I am 
missing here?

Thanks.

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

Reply via email to