From 835c08c2b01e6b1bd287e5c3267efa9710da39e9 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Fri, 28 Jul 2017 14:52:08 +0000 Subject: Added freebsd support --- failsafe.cf | 2 +- services/common.cf | 7 ++++++- services/debian.cf | 2 +- services/freebsd.cf | 10 ++++++++++ services/main.cf | 10 ++++++---- services/ubuntu.cf | 2 +- templates/common/hosts | 2 ++ 7 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 services/freebsd.cf diff --git a/failsafe.cf b/failsafe.cf index ba33f7d..01d4ee8 100644 --- a/failsafe.cf +++ b/failsafe.cf @@ -81,7 +81,7 @@ bundle agent failsafe_update { "$(sys.cf_execd)" classes => failsafe_results("namespace", "cf_execd_running"); cf_serverd_not_running:: "$(sys.cf_serverd)" classes => failsafe_results("namespace", "cf_serverd_running"); - !cfengine3_service_running|(systemd.inputdir_update_repaired):: + systemd.(!cfengine3_service_running|inputdir_update_repaired):: "/bin/systemctl restart cfengine3" contain => failsafe_noshell_and_silent, classes => failsafe_results("namespace", "systemctl_restart_cfengine3"); diff --git a/services/common.cf b/services/common.cf index 0e866a0..729ba1a 100644 --- a/services/common.cf +++ b/services/common.cf @@ -3,7 +3,7 @@ bundle agent common vars: any:: "packages" slist => { - @(distrib.packages), + @(flavour.packages), @(specific.packages), }; files: @@ -19,6 +19,11 @@ bundle agent common policy => "present", package_module => apt_get, classes => if_repaired("common_packages_$(wanted)_add_repaired"); + freebsd:: + "$(packages)" + policy => "present", + package_module => pkg, + classes => if_repaired("common_packages_$(wanted)_add_repaired"); reports: any:: "$(this.bundle): /etc/hosts repaired" ifvarclass => "common_hosts_files_repaired"; diff --git a/services/debian.cf b/services/debian.cf index 8b250d3..30f09c6 100644 --- a/services/debian.cf +++ b/services/debian.cf @@ -1,4 +1,4 @@ -bundle common distrib +bundle common flavour { vars: debian:: diff --git a/services/freebsd.cf b/services/freebsd.cf new file mode 100644 index 0000000..8327832 --- /dev/null +++ b/services/freebsd.cf @@ -0,0 +1,10 @@ +bundle agent flavour +{ + vars: + freebsd:: + "packages" slist => { + "devel/libstatgrab", + "sysutils/muse", + "sysutils/ipmitool", + }; +} diff --git a/services/main.cf b/services/main.cf index 047e4b1..266cd86 100644 --- a/services/main.cf +++ b/services/main.cf @@ -4,16 +4,18 @@ bundle common classify any:: "bundles" slist => { "common", - "distrib", + "flavour", }; "inputs" slist => { "services/common.cf", - "services/$(distrib).cf", + "services/$(flavour).cf", }; debian:: - "distrib" string => "debian"; + "flavour" string => "debian"; + freebsd:: + "flavour" string => "freebsd"; ubuntu:: - "distrib" string => "ubuntu"; + "flavour" string => "ubuntu"; classes: any:: "containers" or => { diff --git a/services/ubuntu.cf b/services/ubuntu.cf index 1f69f82..919a5fe 100644 --- a/services/ubuntu.cf +++ b/services/ubuntu.cf @@ -1,4 +1,4 @@ -bundle common distrib +bundle common flavour { vars: ubuntu:: diff --git a/templates/common/hosts b/templates/common/hosts index 4d060d8..196ffe2 100644 --- a/templates/common/hosts +++ b/templates/common/hosts @@ -19,7 +19,9 @@ ff02::2 ip6-allrouters 10.1.0.206 packages.lxd packages 10.1.0.207 webmail.lxd webmail 10.1.0.208 git.lxd git +10.1.0.209 ns1 +10.1.0.250 cobsd 10.1.0.251 reality 10.1.0.252 hurricane 10.1.0.253 collab -- cgit v1.2.3