Forum: CFEngine Help
Subject: bug? or feature? "set_variable_values" in "cfengine_stdlib.cf"
Author: davidlee
Link to topic: https://cfengine.com/forum/read.php?3,22719,22719#msg-22719

(using 3.1.4 community edition on RHEL 5.x)

The network configuration files on RHEL5 are called "ifcfg-eth2" and look like:
DEVICE=eth2
BOOTPROTO=static
IPADDR=99.99.99.99
NETMASK=255.255.252.0
ONBOOT=yes

in a good, clean "key=value" format.  So we have been using 
"set_variable_values", provided by "cfengine_stdlib.cf", to maintain this data.

We have just started to use this to maintain a bonded interface, whose 
"ifcfg-bond0" file looks very similar.  But one of the required "key=value" 
lines needs to look like:
BONDING_MODULE_OPTS=mode=balance-rr miimon=80

Note that the RHS itself contains the equal '=' separator.

Successive runs of 'cf-agent' cause multiple lines:
BONDING_MODULE_OPTS=mode=balance-rr miimon=80=balance-rr miimon=80=balance-rr 
miimon=80=balance-rr miimon=80
BONDING_MODULE_OPTS=mode=balance-rr miimon=80=balance-rr miimon=80=balance-rr 
miimon=80
BONDING_MODULE_OPTS=mode=balance-rr miimon=80=balance-rr miimon=80
BONDING_MODULE_OPTS=mode=balance-rr miimon=80

which is clearly not what is intended, and would presumably try to reach 
infinity.

Bug?  (Or if a feature, how should we correctly be using this?  And why doesn't 
cfengine spot the non-convergence?)

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

Reply via email to