From 5f4f78d55d832d31639119804e7ff9f69ecdda41 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sun, 27 Aug 2017 23:31:08 +0200 Subject: Updated usebundle system to include caller information un report --- services/os/debian.cf | 5 ++++- services/os/freebsd.cf | 9 ++++++--- services/os/ubuntu.cf | 5 ++++- 3 files changed, 14 insertions(+), 5 deletions(-) (limited to 'services/os') diff --git a/services/os/debian.cf b/services/os/debian.cf index 3d73c2b..48f691d 100644 --- a/services/os/debian.cf +++ b/services/os/debian.cf @@ -1,4 +1,4 @@ -bundle common debian +bundle agent debian { vars: debian:: @@ -50,4 +50,7 @@ bundle common debian "weechat", "whois", }; + methods: + debian:: + "debian" usebundle => install_package("$(this.bundle)", "$(debian.packages)"); } diff --git a/services/os/freebsd.cf b/services/os/freebsd.cf index 7c930db..1029b25 100644 --- a/services/os/freebsd.cf +++ b/services/os/freebsd.cf @@ -6,9 +6,12 @@ bundle agent freebsd "bash", "ncdu", }; + methods: + freebsd:: + "freebsd" usebundle => install_package("$(this.bundle)", "$(freebsd.packages)"); } -bundle agent add_rc_conf_line(line) +bundle agent add_rc_conf_line(caller, line) { files: freebsd:: @@ -17,8 +20,8 @@ bundle agent add_rc_conf_line(line) edit_defaults => std_defs, perms => system_owned("444"), edit_line => append_if_no_line("$(line)"), - classes => if_repaired("freebsd_rc_conf_file_repaired"); + classes => if_repaired("$(caller)_freebsd_rc_conf_file_repaired"); reports: any:: - "$(this.bundle): /etc/rc.conf repaired" ifvarclass => "freebsd_rc_conf_file_repaired"; + "$(caller): /etc/rc.conf repaired" ifvarclass => "$(caller)_freebsd_rc_conf_file_repaired"; } diff --git a/services/os/ubuntu.cf b/services/os/ubuntu.cf index 58bd2d5..e3759b1 100644 --- a/services/os/ubuntu.cf +++ b/services/os/ubuntu.cf @@ -1,4 +1,4 @@ -bundle common ubuntu +bundle agent ubuntu { vars: ubuntu:: @@ -50,4 +50,7 @@ bundle common ubuntu "weechat", "whois", }; + methods: + ubuntu:: + "ubuntu" usebundle => install_package("$(this.bundle)", "$(ubuntu.packages)"); } -- cgit v1.2.3