From 60b9fbacf5ab42705ea857db2e5cca6ed3c34f02 Mon Sep 17 00:00:00 2001 From: Roberto Valentini Date: Fri, 5 Apr 2024 15:37:51 +0200 Subject: [PATCH] Drop unused code for usupported OS --- data/os/Debian/Debian/7.yaml | 8 -------- data/os/Debian/Debian/8.yaml | 8 -------- data/os/RedHat/CentOS/6.yaml | 7 ------- data/os/RedHat/RedHat/6.yaml | 6 ------ spec/classes/director_spec.rb | 18 +++--------------- spec/classes/storage_spec.rb | 26 ++++---------------------- 6 files changed, 7 insertions(+), 66 deletions(-) delete mode 100644 data/os/Debian/Debian/7.yaml delete mode 100644 data/os/Debian/Debian/8.yaml delete mode 100644 data/os/RedHat/CentOS/6.yaml delete mode 100644 data/os/RedHat/RedHat/6.yaml diff --git a/data/os/Debian/Debian/7.yaml b/data/os/Debian/Debian/7.yaml deleted file mode 100644 index 3be5dcd2e..000000000 --- a/data/os/Debian/Debian/7.yaml +++ /dev/null @@ -1,8 +0,0 @@ ---- -bacula::director::packages: - - 'bacula-director-common' - - 'bacula-director-<%= $db_type %>' - - 'bacula-console' -bacula::storage::packages: - - 'bacula-sd' - - 'bacula-sd-<%= $db_type %>' diff --git a/data/os/Debian/Debian/8.yaml b/data/os/Debian/Debian/8.yaml deleted file mode 100644 index 3be5dcd2e..000000000 --- a/data/os/Debian/Debian/8.yaml +++ /dev/null @@ -1,8 +0,0 @@ ---- -bacula::director::packages: - - 'bacula-director-common' - - 'bacula-director-<%= $db_type %>' - - 'bacula-console' -bacula::storage::packages: - - 'bacula-sd' - - 'bacula-sd-<%= $db_type %>' diff --git a/data/os/RedHat/CentOS/6.yaml b/data/os/RedHat/CentOS/6.yaml deleted file mode 100644 index c870a2206..000000000 --- a/data/os/RedHat/CentOS/6.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -bacula::storage::packages: [ 'bacula-storage-common' ] -bacula::director::packages: - - 'bacula-director-common' - - 'bacula-director-<%= $db_type %>' - - 'bacula-console' - diff --git a/data/os/RedHat/RedHat/6.yaml b/data/os/RedHat/RedHat/6.yaml deleted file mode 100644 index dd677c616..000000000 --- a/data/os/RedHat/RedHat/6.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -bacula::storage::packages: [ 'bacula-storage-common' ] -bacula::director::packages: - - 'bacula-director-common' - - 'bacula-director-<%= $db_type %>' - - 'bacula-console' diff --git a/spec/classes/director_spec.rb b/spec/classes/director_spec.rb index 712ca4437..06c4db64d 100644 --- a/spec/classes/director_spec.rb +++ b/spec/classes/director_spec.rb @@ -13,24 +13,12 @@ when 'Debian' it { is_expected.to contain_class('bacula::director') } - case facts[:os]['release']['major'] - when '7', '8' - expected_packages << 'bacula-director-common' - when '9' - expected_packages << 'bacula-director' - end + expected_packages << 'bacula-director' expected_packages << 'bacula-director-pgsql' expected_packages << 'bacula-console' when 'RedHat' - case facts[:os]['release']['major'] - when '6' - expected_packages << 'bacula-director-common' - expected_packages << 'bacula-console' - expected_packages << 'bacula-director' - else - expected_packages << 'bacula-director' - expected_packages << 'bacula-console' - end + expected_packages << 'bacula-director' + expected_packages << 'bacula-console' when 'OpenBSD' expected_packages << 'bacula-server' expected_packages << 'bacula-pgsql' diff --git a/spec/classes/storage_spec.rb b/spec/classes/storage_spec.rb index 323dc5f9d..2590ca29c 100644 --- a/spec/classes/storage_spec.rb +++ b/spec/classes/storage_spec.rb @@ -21,29 +21,11 @@ case facts[:os]['family'] when 'Debian' it { is_expected.to contain_package('bacula-sd') } - - case facts[:os]['release']['major'] - when '7', '8' - it { is_expected.to contain_package('bacula-sd-pgsql') } - end when 'RedHat' - case facts[:os]['release']['major'] - when '6' - it do - is_expected.to contain_package('bacula-storage-common').with( - 'ensure' => 'installed' - ) - end - - it { is_expected.not_to contain_package('bacula-storage') } - else - it do - is_expected.to contain_package('bacula-storage').with( - 'ensure' => 'installed' - ) - end - - it { is_expected.not_to contain_package('bacula-storage-common') } + it do + is_expected.to contain_package('bacula-storage').with( + 'ensure' => 'installed' + ) end when 'OpenBSD' it { is_expected.to contain_package('bacula-server') }