Monthly Archives: March 2013

Canonifying a list with CFEngine 3

John Sanders shared a pattern for canonifying lists in #CFEngine on yesterday. It’s a useful reference so I thought I would replicate it here.   In lines 9-12 of the example policy we build an array with values that need to be canonified. We use getindices to get the list of the first index. […]

Working around getindices with dynamically generated arrays in CFEngine 3

There is a known bug where getindices is unable to get the index of a dynamically generated array until the next pass. This comes up from time to time so I thought I would post an example using a pattern shared on the CFEngine help mailing list. The policy below shows 3 working examples. They […]

Deep thoughts

bundle common knowledge(status) {   vars:     “software” string => “$(status)”, policy => “free”;     !isUsable::       “software” string => “usable”, policy => “free”;     isUsable::       “software” string => “reusable”, policy => “free”;   classes:     “isUsable” expression => regcmp(“$(software)”, “usable”);     “reUsable” expression => regcmp(“$(software)”, “resuable”);   reports:       Morning|Afternoon|Evening|Night::         “Before software […]