summaryrefslogtreecommitdiff
path: root/cfengine
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--cfengine/core_policies.cf7
-rw-r--r--cfengine/watchdog.cf20
2 files changed, 27 insertions, 0 deletions
diff --git a/cfengine/core_policies.cf b/cfengine/core_policies.cf
new file mode 100644
index 0000000..b919b59
--- /dev/null
+++ b/cfengine/core_policies.cf
@@ -0,0 +1,7 @@
+bundle common core_policies
+{
+ vars:
+ any::
+ "bundles" slist => { "cfengine_watchdog" };
+ "inputs" slist => { "cfengine/watchdog.cf" };
+}
diff --git a/cfengine/watchdog.cf b/cfengine/watchdog.cf
new file mode 100644
index 0000000..22d045d
--- /dev/null
+++ b/cfengine/watchdog.cf
@@ -0,0 +1,20 @@
+bundle agent cfengine_watchdog
+{
+ vars:
+ systemd::
+ "data" string => '{"systemd": true}';
+ !systemd::
+ "data" string => '{"systemd": false}';
+ files:
+ any::
+ "/etc/cron.d/cfengine_watchdog"
+ create => "true",
+ perms => system_owned("444"),
+ edit_template => "$(sys.inputdir)/templates/cfengine/cfengine_watchdog",
+ template_method => "mustache",
+ template_data => parsejson("$(data)"),
+ classes => if_repaired("cfengine_watchdog_repaired");
+ reports:
+ any::
+ "$(this.bundle): /etc/cron.d/cfengine_watchdog repaired" ifvarclass => "cfengine_watchdog_repaired";
+}