summaryrefslogtreecommitdiff
path: root/cfengine
diff options
context:
space:
mode:
authorJulien Dessaux2017-03-10 13:50:24 +0100
committerJulien Dessaux2017-03-10 14:11:02 +0100
commit6e2f04d2859bc432622f82f9b2d00c88557a24c2 (patch)
treea983b33767c3e8101e62fbe4a96495ed59d38f71 /cfengine
parentAdded cfengine_modules submodule (diff)
downloadmasterfiles-6e2f04d2859bc432622f82f9b2d00c88557a24c2.tar.gz
masterfiles-6e2f04d2859bc432622f82f9b2d00c88557a24c2.tar.bz2
masterfiles-6e2f04d2859bc432622f82f9b2d00c88557a24c2.zip
Added cfengine watchdog policy
Diffstat (limited to 'cfengine')
-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";
+}