Skip to content

Instantly share code, notes, and snippets.

@daebenji
daebenji / changes-to-update.cf
Created June 29, 2018 10:45 — forked from zzamboni/changes-to-update.cf
How to automatically update /var/cfengine/masterfiles on a CFEngine policy hub from a Subversion or Git repository.
# These go in update.cf (in CFEngine community) or update_policy.cf (in CFEngine Enterprise).
# Once these are in place, you need to manually check out /var/cfengine/masterfiles from the appropriate repository.
# From then on, "svn up" will be run on it periodically to keep it up to date with respect to the repository.
# This needs to be added to the classes: section of the update bundle
# Change .svn to .git to use git.
classes:
"masterfiles_in_svn"
expression => fileexists("$(master_location)/.svn"),
comment => "Check if $(master_location) is checked out from subversion",