I had lost track of the fact you still needed me to provide a test case.
Here it is. It is extracted from a real part of our policy, setting a key=value in RH8 "/etc/dnf/automatic.conf" (I've slightly tweaked it to make it standalone and using a safe target file).
Run it at least twice (or as often as you like). You'll see that although the target file successfully converges, CFE persists in (falsely) reporting errors.
Please could you take it forward from this?
=================================================================
#
# Demonstrate CFEngine "edit_line" bug:
#
body file control
{
inputs => { "/var/cfengine/inputs/lib/
files.cf" };
}
bundle agent __main__
{
vars:
any::
#"fname" string => "/etc/dnf/automatic.conf";
"fname" string => "/tmp/automatic.conf";
"tab[commands][apply_updates]" string => "no";
files:
any::
"$(fname)"
edit_line => set_variable_values_ini("$(this.bundle).tab", "commands");
}
=================================================================
Thanks.
-- David Lee