Today I stumbled upon an unexpected behaviour change in CFEngine templates when upgrading from version 3.4 to 3.6. The change is not documented anywhere in the Changelog, so I am really not sure if it’s a bug or a feature. In any case, it is something to be aware of.
Take this template:
Normally, each line expands to an insert lines promise, which means that duplicated lines may not be printed more than once. That behavior has changed with CFEngine versions. [%CFEngine cfengine_3_4:: %] In this version of CFEngine, $(sys.cf_version), duplicates are printed once In this version of CFEngine, $(sys.cf_version), duplicates are printed once In this version of CFEngine, $(sys.cf_version), duplicates are printed once that holds for blank lines, too [%CFEngine cfengine_3_6:: %] In this version of CFEngine, $(sys.cf_version), duplicates are preserved In this version of CFEngine, $(sys.cf_version), duplicates are preserved In this version of CFEngine, $(sys.cf_version), duplicates are preserved [%CFEngine any:: %] End of the story!
and this policy:
bundle agent test_example_cf3_template
{
vars:
cfengine_3_4::
"templatedir" string => execresult("/bin/pwd","noshell") ;
"testfile" string => "/tmp/cf_34.txt" ;
cfengine_3_6::
"templatedir" string => "$(this.promise_dirname)" ;
"testfile" string => "/tmp/cf_36.txt" ;
files:
"$(testfile)"
create => "yes",
edit_template => "$(templatedir)/example_cf3_template.tmpl";
reports:
cfengine_3::
"Check output in $(testfile)" ;
}
Now run the policy in both CFEngine 3.4 and 3.6. You’d expect to get two identical files: /tmp/cf_34.txt and /tmp/cf_36.txt. But they’re not.
The Config Management Camp 2015 is gone leaving its trail of inspiring presentations, interesting discussions, pleasant meetings with great people and, hopefully, satisfaction for how each of us has played his/her part to make this edition a success.


It’s going to happen again:
UNIX init systems are not a topic people discusses a lot about, usually. There is some buzz when a new one is out, some more buzz when it is adopted in other shops than those where it was born, then most OS keep on with their old solution (usually the System V init system, or sysvinit) and everything falls back to radio silence. Other times, I assume, things cut short from some buzz and directly into the radio silence phase. I’ve been into the