From ad62733781814faf0cbace9d58c4a034f4138b6a Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Mon, 31 Jul 2017 21:41:28 +0000 Subject: Patched failsafe.cf for freebsd support --- failsafe.cf | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'failsafe.cf') 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:: @@ -126,6 +154,17 @@ When updating masterfiles, wait (usually 5 minutes) for files to propagate to in "Failed to start the scheduler"; } +############################################ +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) { -- cgit v1.2.3