From 5239846956644f27d1619ce43b742034925d3ebc Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Fri, 25 Aug 2017 17:21:05 +0200 Subject: Changed policies organisation to use methods --- services/common.cf | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) (limited to 'services/common.cf') diff --git a/services/common.cf b/services/common.cf index 7cb92d5..b5e7b75 100644 --- a/services/common.cf +++ b/services/common.cf @@ -1,13 +1,5 @@ bundle agent common { - vars: - any:: - "packages" slist => { - @(flavour.packages), - @(julien.packages), - @(bareos_fd.packages), - @(specific.packages), - }; files: any:: "/etc/hosts" @@ -15,21 +7,9 @@ bundle agent common perms => system_owned("444"), edit_template => "$(sys.inputdir)/templates/common/hosts", classes => if_repaired("common_hosts_files_repaired"); - packages: - debian|ubuntu:: - "$(packages)" - policy => "present", - package_module => apt_get, - classes => if_repaired("common_packages_$(packages)_add_repaired"); - freebsd:: - "$(packages)" - policy => "present", - package_module => pkg, - classes => if_repaired("common_packages_$(packages)_add_repaired"); reports: any:: "$(this.bundle): /etc/hosts repaired" ifvarclass => "common_hosts_files_repaired"; - "$(this.bundle): $(packages) installed" ifvarclass => "common_packages_$(packages)_add_repaired"; } bundle agent home_skel(user) @@ -45,3 +25,21 @@ bundle agent home_skel(user) any:: "$(this.bundle): /home/$(user) initialized" ifvarclass => "home_skel_$(user)_repaired"; } + +bundle agent install_package(package) +{ + packages: + debian|ubuntu:: + "$(package)" + policy => "present", + package_module => apt_get, + classes => if_repaired("common_package_$(package)_add_repaired"); + freebsd:: + "$(package)" + policy => "present", + package_module => pkg, + classes => if_repaired("common_package_$(package)_add_repaired"); + reports: + any:: + "$(this.bundle): $(package) installed" ifvarclass => "common_package_$(package)_add_repaired"; +} -- cgit v1.2.3