Skip to content

Instantly share code, notes, and snippets.

@rpetre
Created July 30, 2012 18:06
Show Gist options
  • Select an option

  • Save rpetre/3208756 to your computer and use it in GitHub Desktop.

Select an option

Save rpetre/3208756 to your computer and use it in GitHub Desktop.
this seems to work properly
body common control {
bundlesequence => { "update" };
}
bundle common g {
vars:
"sandbox_lockfile" string => "/var/cfengine/sandbox";
has_branch.cf_test::
"message" string => "I am a test machine";
has_branch.cf_prod.!cf_test::
"message" string => "I am a prod machine";
classes:
"cf_test" expression => fileexists("$(sandbox_lockfile)");
"cf_prod" expression => "!cf_test";
"has_branch" expression => "any";
}
bundle agent update {
files:
cf_prod::
"$(g.sandbox_lockfile)"
delete => cleanup;
cf_test.!cf_prod::
"$(g.sandbox_lockfile)"
create => "true";
reports:
cfengine::
"$(g.message)";
}
body delete cleanup {
dirlinks => "tidy";
rmdirs => "true";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment