summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Dessaux2017-08-24 13:15:56 +0000
committerJulien Dessaux2017-08-24 15:21:00 +0200
commitcab089deb4dc10d4f9d784a22d5d0005288fcb61 (patch)
tree01a907deebf0becbf1b73f0a1f328397bf934fe6
parentFixed check_mk policy misbehavior (diff)
downloadmasterfiles-cab089deb4dc10d4f9d784a22d5d0005288fcb61.tar.gz
masterfiles-cab089deb4dc10d4f9d784a22d5d0005288fcb61.tar.bz2
masterfiles-cab089deb4dc10d4f9d784a22d5d0005288fcb61.zip
Added bareos-fd policy
Diffstat (limited to '')
-rw-r--r--services/bareos_fd.cf34
-rw-r--r--services/common.cf1
-rw-r--r--services/freebsd.cf1
-rw-r--r--services/main.cf4
4 files changed, 39 insertions, 1 deletions
diff --git a/services/bareos_fd.cf b/services/bareos_fd.cf
new file mode 100644
index 0000000..457655d
--- /dev/null
+++ b/services/bareos_fd.cf
@@ -0,0 +1,34 @@
+bundle agent bareos_fd
+{
+ vars:
+ freebsd::
+ "packages" slist => {
+ "bareos-client",
+ };
+ "rc_conf_lines" slist => {
+ "bareos_fd_enable=\"YES\"",
+ "bareos_fd_config=\"/usr/local/etc/bareos/\"",
+ };
+ !freebsd::
+ "packages" slist => {};
+ classes:
+ freebsd::
+ "bareos_fd_service_running" expression => returnszero("/usr/sbin/service bareos-fd status", "noshell");
+ files:
+ freebsd::
+ "/usr/local/etc/bareos/bareos-fd.d/client/myself.conf"
+ edit_defaults => std_defs,
+ perms => system_owned("444"),
+ edit_line => replace_line_end("Name =", "$(sys.host)-fd"),
+ classes => if_repaired("bareos_client_file_repaired");
+ commands:
+ freebsd.!bareos_fd_service_running::
+ "/usr/sbin/service bareos-fd start" classes => if_repaired("bareos_fd_service_repaired");
+ freebsd.bareos_client_file_repaired::
+ "/usr/sbin/service bareos-fd restart" classes => if_repaired("bareos_fd_service_restarted");
+ reports:
+ any::
+ "$(this.bundle): /usr/local/etc/bareos/bareos-fd.d/client/myself.conf repaired" ifvarclass => "bareos_client_file_repaired";
+ "$(this.bundle): bareos-fd service repaired" ifvarclass => "bareos_fd_service_repaired";
+ "$(this.bundle): bareos-fd service restarted" ifvarclass => "bareos_fd_service_restarted";
+}
diff --git a/services/common.cf b/services/common.cf
index 8f93cc4..7cb92d5 100644
--- a/services/common.cf
+++ b/services/common.cf
@@ -5,6 +5,7 @@ bundle agent common
"packages" slist => {
@(flavour.packages),
@(julien.packages),
+ @(bareos_fd.packages),
@(specific.packages),
};
files:
diff --git a/services/freebsd.cf b/services/freebsd.cf
index 730e799..c83e08f 100644
--- a/services/freebsd.cf
+++ b/services/freebsd.cf
@@ -7,6 +7,7 @@ bundle agent flavour
"ncdu",
};
"rc_conf_lines" slist => {
+ @(bareos_fd.rc_conf_lines),
@(check_mk.rc_conf_lines),
};
files:
diff --git a/services/main.cf b/services/main.cf
index e4a8725..3bde9b0 100644
--- a/services/main.cf
+++ b/services/main.cf
@@ -4,15 +4,17 @@ bundle common classify
any::
"bundles" slist => {
"common",
+ "bareos_fd",
"check_mk",
"flavour",
"julien",
"sshd",
};
"inputs" slist => {
- "services/check_mk.cf",
"services/common.cf",
"services/$(flavour).cf",
+ "services/bareos_fd.cf",
+ "services/check_mk.cf",
"services/julien.cf",
"services/sshd.cf",
};