summaryrefslogtreecommitdiff
path: root/failsafe.cf
diff options
context:
space:
mode:
authorJulien Dessaux2017-07-31 21:41:28 +0000
committerJulien Dessaux2017-08-04 07:34:34 +0000
commitad62733781814faf0cbace9d58c4a034f4138b6a (patch)
tree4dee24662d9d98d02e7dfd9d47df6d33b84b0682 /failsafe.cf
parentFixed reporting bug in common package policy (diff)
downloadmasterfiles-ad62733781814faf0cbace9d58c4a034f4138b6a.tar.gz
masterfiles-ad62733781814faf0cbace9d58c4a034f4138b6a.tar.bz2
masterfiles-ad62733781814faf0cbace9d58c4a034f4138b6a.zip
Patched failsafe.cf for freebsd support
Diffstat (limited to 'failsafe.cf')
-rw-r--r--failsafe.cf39
1 files changed, 39 insertions, 0 deletions
diff --git a/failsafe.cf b/failsafe.cf
index 01d4ee8..daba0fc 100644
--- a/failsafe.cf
+++ b/failsafe.cf
@@ -14,6 +14,9 @@ bundle agent main {
"Check Keys"
usebundle => failsafe_checkkeys,
comment => "Without a valid keypair we aren't going to be able to establish trust";
+ "Copy binaries"
+ usebundle => failsafe_copy_binaries,
+ comment => "Not all distributions populate /var/cfengine/bin";
"Fetch Inputs"
usebundle => failsafe_update,
comment => "We need to fetch policy from upstream if we are bootstrapping or if we are performing failsafe recovery.";
@@ -32,6 +35,31 @@ bundle agent failsafe_checkkeys
"No public/private key pair is loaded, please create one by running \"cf-key\"" classes => failsafe_results("namespace", "no_ppkeys_ABORT");
}
+bundle agent failsafe_copy_binaries
+{
+ vars:
+ freebsd::
+ "binaries" slist => {
+ "cf-agent",
+ "cf-execd",
+ "cf-key",
+ "cf-monitord",
+ "cf-promises",
+ "cf-runagent",
+ "cf-serverd",
+ "cf-upgrade",
+ };
+ files:
+ freebsd::
+ "$(sys.bindir)/$(binaries)"
+ copy_from => failsafe_cp("/usr/local/sbin/$(binaries)"),
+ action => failsafe_u_immediate,
+ classes => failsafe_results("namespace", "copy_binaries");
+ reports:
+ copy_binaries_repaired::
+ "cf-engine binaries updated";
+}
+
bundle agent failsafe_update {
vars:
any::
@@ -127,6 +155,17 @@ When updating masterfiles, wait (usually 5 minutes) for files to propagate to in
}
############################################
+body copy_from failsafe_cp(from)
+{
+ any::
+ source => "$(from)";
+ compare => "digest";
+ encrypt => "true";
+ verify => "true";
+ copy_backup => "false";
+ purge => "true";
+}
+############################################
body copy_from failsafe_scp(from)
{
any::