Skip to content

Instantly share code, notes, and snippets.

@zzamboni
Created February 16, 2012 23:03
Show Gist options
  • Select an option

  • Save zzamboni/1848592 to your computer and use it in GitHub Desktop.

Select an option

Save zzamboni/1848592 to your computer and use it in GitHub Desktop.
How to define in CFEngine 3 a class as the result of ORing several other classes
body common control
{
inputs => { "/var/cfengine/inputs/cfengine_stdlib.cf" };
bundlesequence => { "test" };
}
bundle agent test
{
vars:
"pkg" slist => { "one", "two", "three" };
classes:
"one" expression => "any";
# a is set to its previous value, ORed with the class indicated by $(pkg),
# looping over all the values in @(pkg).
"a" or => { "a", "$(pkg)" };
reports:
a::
"a is set";
!a::
"a is not set";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment