From 3c84663f2becdfe7633ae4dfc91317bc19a8d272 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Thu, 24 Aug 2017 09:00:14 +0000 Subject: Generalised the rc.conf management for freebsd --- services/check_mk.cf | 7 ------- services/freebsd.cf | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 7 deletions(-) (limited to 'services') diff --git a/services/check_mk.cf b/services/check_mk.cf index e83ca06..dde8219 100644 --- a/services/check_mk.cf +++ b/services/check_mk.cf @@ -8,12 +8,6 @@ bundle agent check_mk }; files: freebsd:: - "/etc/rc.conf" - create => "true", - edit_defaults => std_defs, - perms => system_owned("444"), - edit_line => append_if_no_line("$(rc_conf_lines)"), - classes => if_repaired("check_mk_rc_conf_file_repaired"); "/etc/services" edit_defaults => std_defs, perms => system_owned("444"), @@ -39,7 +33,6 @@ bundle agent check_mk "/usr/sbin/service inetd restart" classes => if_repaired("inetd_service_restarted"); reports: any:: - "$(this.bundle): /etc/rc.conf repaired" ifvarclass => "check_mk_rc_conf_file_repaired"; "$(this.bundle): /etc/services repaired" ifvarclass => "check_mk_services_file_repaired"; "$(this.bundle): /etc/inetd.conf repaired" ifvarclass => "check_mk_inetd_conf_file_repaired"; "$(this.bundle): /usr/local/bin/check_mk_agent repaired" ifvarclass => "check_mk_agent_repaired"; diff --git a/services/freebsd.cf b/services/freebsd.cf index 603c82d..730e799 100644 --- a/services/freebsd.cf +++ b/services/freebsd.cf @@ -6,4 +6,18 @@ bundle agent flavour "bash", "ncdu", }; + "rc_conf_lines" slist => { + @(check_mk.rc_conf_lines), + }; + files: + freebsd:: + "/etc/rc.conf" + create => "true", + edit_defaults => std_defs, + perms => system_owned("444"), + edit_line => append_if_no_line("$(rc_conf_lines)"), + classes => if_repaired("freebsd_rc_conf_file_repaired"); + reports: + any:: + "$(this.bundle): /etc/rc.conf repaired" ifvarclass => "freebsd_rc_conf_file_repaired"; } -- cgit v1.2.3