Nix ifvarclass and other changes I wish for CFEngine

Tags:

I am frequently asked what I would change in CFEngine if I had the power.

My high level answer is documentation. It is still too hard for new comers to get started with CFEngine and experienced users do not have access to detailed low level documentation. How does the client server handshake work? How does cf_promises_validated work? How do I read debugging output? I wish I could answer these questions using official citations. There is an effort underway to improve documentation.

At a lower level the are other things I would change. Here are a few.

Better redundancy

While file copies can fail over to multiple servers it is not possible to bootstrap a host to multiple servers. This makes creating fail over servers cumbersome because keys have to be exchanged using manual or home grown automatic methods. There is an outstanding feature request for this.

Whitespace in variables and classes

Variable expressions like

${meth[${i}][3]}

are an eyesore. I wish I could use whitespace and rewrite them as

${meth[ ${i} ][ 3 ]}

Similarly class expressions like

dmz_hosts.!(hosta|hostb|hostc)::

would be easier to read as

dmz_hosts .! ( hosta|hostb|hostc )::

There is an open feature request for this.

Nix ifvarclass

While we are on the subject of classes, let's talk about ifvarclass. I hate it. New users often wrongly think ifvarclass can define a class. Truly ifvarclass exists only because this is illegal syntax:

files:
   ${myclass}::
      "/path/to/promiser"
         yada => yada;

The above is so much clearer to the reader than the abomination that is ifvarclass.

files:
   "/path/to/promiser"
      ifvarclass => "${myclass}",
      yada       => yada;

Removing ifvarclass has been discussed in the past, but no changes are pending.

submit to reddit