From 423a96d5dd1f87d36dac974805b0e8573d71a8e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Tue, 13 Aug 2024 11:28:07 +0200 Subject: [PATCH] Get rid of the `osfamily` legacy fact --- spec/classes/openldap_client_config_spec.rb | 66 +++++++++---------- spec/classes/openldap_client_install_spec.rb | 2 +- spec/classes/openldap_client_spec.rb | 2 +- spec/classes/openldap_server_config_spec.rb | 2 +- spec/classes/openldap_server_install_spec.rb | 2 +- spec/classes/openldap_server_service_spec.rb | 2 +- .../classes/openldap_server_slapdconf_spec.rb | 2 +- spec/classes/openldap_server_spec.rb | 2 +- spec/classes/openldap_utils_spec.rb | 2 +- 9 files changed, 41 insertions(+), 41 deletions(-) diff --git a/spec/classes/openldap_client_config_spec.rb b/spec/classes/openldap_client_config_spec.rb index 704f1414..942721f4 100644 --- a/spec/classes/openldap_client_config_spec.rb +++ b/spec/classes/openldap_client_config_spec.rb @@ -28,7 +28,7 @@ it { is_expected.to contain_class('openldap::client::config') } it { is_expected.to contain_augeas('ldap.conf') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_augeas('ldap.conf').with(incl: '/etc/ldap/ldap.conf', @@ -51,7 +51,7 @@ it { is_expected.to contain_class('openldap::client::config') } it { is_expected.to contain_augeas('ldap.conf') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_augeas('ldap.conf').with(incl: '/etc/ldap/ldap.conf', @@ -74,7 +74,7 @@ it { is_expected.to contain_class('openldap::client::config') } it { is_expected.to contain_augeas('ldap.conf') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_augeas('ldap.conf').with(incl: '/etc/ldap/ldap.conf', @@ -97,7 +97,7 @@ it { is_expected.to contain_class('openldap::client::config') } it { is_expected.to contain_augeas('ldap.conf') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_augeas('ldap.conf').with(incl: '/etc/ldap/ldap.conf', @@ -120,7 +120,7 @@ it { is_expected.to contain_class('openldap::client::config') } it { is_expected.to contain_augeas('ldap.conf') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_augeas('ldap.conf').with(incl: '/etc/ldap/ldap.conf', @@ -143,7 +143,7 @@ it { is_expected.to contain_class('openldap::client::config') } it { is_expected.to contain_augeas('ldap.conf') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_augeas('ldap.conf').with(incl: '/etc/ldap/ldap.conf', @@ -166,7 +166,7 @@ it { is_expected.to contain_class('openldap::client::config') } it { is_expected.to contain_augeas('ldap.conf') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_augeas('ldap.conf').with(incl: '/etc/ldap/ldap.conf', @@ -189,7 +189,7 @@ it { is_expected.to contain_class('openldap::client::config') } it { is_expected.to contain_augeas('ldap.conf') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_augeas('ldap.conf').with(incl: '/etc/ldap/ldap.conf', @@ -212,7 +212,7 @@ it { is_expected.to contain_class('openldap::client::config') } it { is_expected.to contain_augeas('ldap.conf') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_augeas('ldap.conf').with(incl: '/etc/ldap/ldap.conf', @@ -235,7 +235,7 @@ it { is_expected.to contain_class('openldap::client::config') } it { is_expected.to contain_augeas('ldap.conf') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_augeas('ldap.conf').with(incl: '/etc/ldap/ldap.conf', @@ -258,7 +258,7 @@ it { is_expected.to contain_class('openldap::client::config') } it { is_expected.to contain_augeas('ldap.conf') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_augeas('ldap.conf').with(incl: '/etc/ldap/ldap.conf', @@ -281,7 +281,7 @@ it { is_expected.to contain_class('openldap::client::config') } it { is_expected.to contain_augeas('ldap.conf') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_augeas('ldap.conf').with(incl: '/etc/ldap/ldap.conf', @@ -304,7 +304,7 @@ it { is_expected.to contain_class('openldap::client::config') } it { is_expected.to contain_augeas('ldap.conf') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_augeas('ldap.conf').with(incl: '/etc/ldap/ldap.conf', @@ -327,7 +327,7 @@ it { is_expected.to contain_class('openldap::client::config') } it { is_expected.to contain_augeas('ldap.conf') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_augeas('ldap.conf').with(incl: '/etc/ldap/ldap.conf', @@ -350,7 +350,7 @@ it { is_expected.to contain_class('openldap::client::config') } it { is_expected.to contain_augeas('ldap.conf') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_augeas('ldap.conf').with(incl: '/etc/ldap/ldap.conf', @@ -373,7 +373,7 @@ it { is_expected.to contain_class('openldap::client::config') } it { is_expected.to contain_augeas('ldap.conf') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_augeas('ldap.conf').with(incl: '/etc/ldap/ldap.conf', @@ -396,7 +396,7 @@ it { is_expected.to contain_class('openldap::client::config') } it { is_expected.to contain_augeas('ldap.conf') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_augeas('ldap.conf').with(incl: '/etc/ldap/ldap.conf', @@ -419,7 +419,7 @@ it { is_expected.to contain_class('openldap::client::config') } it { is_expected.to contain_augeas('ldap.conf') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_augeas('ldap.conf').with(incl: '/etc/ldap/ldap.conf', @@ -442,7 +442,7 @@ it { is_expected.to contain_class('openldap::client::config') } it { is_expected.to contain_augeas('ldap.conf') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_augeas('ldap.conf').with(incl: '/etc/ldap/ldap.conf', @@ -465,7 +465,7 @@ it { is_expected.to contain_class('openldap::client::config') } it { is_expected.to contain_augeas('ldap.conf') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_augeas('ldap.conf').with({ @@ -492,7 +492,7 @@ it { is_expected.to contain_class('openldap::client::config') } it { is_expected.to contain_augeas('ldap.conf') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_augeas('ldap.conf').with(incl: '/etc/ldap/ldap.conf', @@ -515,7 +515,7 @@ it { is_expected.to contain_class('openldap::client::config') } it { is_expected.to contain_augeas('ldap.conf') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_augeas('ldap.conf').with(incl: '/etc/ldap/ldap.conf', @@ -538,7 +538,7 @@ it { is_expected.to contain_class('openldap::client::config') } it { is_expected.to contain_augeas('ldap.conf') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_augeas('ldap.conf').with(incl: '/etc/ldap/ldap.conf', @@ -561,7 +561,7 @@ it { is_expected.to contain_class('openldap::client::config') } it { is_expected.to contain_augeas('ldap.conf') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_augeas('ldap.conf').with(incl: '/etc/ldap/ldap.conf', @@ -583,7 +583,7 @@ it { is_expected.to compile.with_all_deps } it { is_expected.to contain_class('openldap::client::config') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_augeas('ldap.conf').with(incl: '/etc/ldap/ldap.conf', @@ -606,7 +606,7 @@ it { is_expected.to contain_class('openldap::client::config') } it { is_expected.to contain_augeas('ldap.conf') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_augeas('ldap.conf').with(incl: '/etc/ldap/ldap.conf', @@ -629,7 +629,7 @@ it { is_expected.to contain_class('openldap::client::config') } it { is_expected.to contain_augeas('ldap.conf') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_augeas('ldap.conf').with(incl: '/etc/ldap/ldap.conf', @@ -652,7 +652,7 @@ it { is_expected.to contain_class('openldap::client::config') } it { is_expected.to contain_augeas('ldap.conf') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_augeas('ldap.conf').with(incl: '/etc/ldap/ldap.conf', @@ -675,7 +675,7 @@ it { is_expected.to contain_class('openldap::client::config') } it { is_expected.to contain_augeas('ldap.conf') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_augeas('ldap.conf').with(incl: '/etc/ldap/ldap.conf', @@ -698,7 +698,7 @@ it { is_expected.to contain_class('openldap::client::config') } it { is_expected.to contain_augeas('ldap.conf') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_augeas('ldap.conf').with(incl: '/etc/ldap/ldap.conf', @@ -727,7 +727,7 @@ it { is_expected.to contain_class('openldap::client::config') } it { is_expected.to contain_augeas('ldap.conf') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_augeas('ldap.conf').with(incl: '/etc/ldap/ldap.conf', @@ -762,7 +762,7 @@ it { is_expected.to contain_class('openldap::client::config') } it { is_expected.to contain_augeas('ldap.conf') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_augeas('ldap.conf').with(incl: '/etc/ldap/ldap.conf', @@ -789,7 +789,7 @@ it { is_expected.to contain_class('openldap::client::config') } it { is_expected.to contain_augeas('ldap.conf') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_augeas('ldap.conf').with(incl: '/etc/ldap/ldap.conf', diff --git a/spec/classes/openldap_client_install_spec.rb b/spec/classes/openldap_client_install_spec.rb index 80900450..17580603 100644 --- a/spec/classes/openldap_client_install_spec.rb +++ b/spec/classes/openldap_client_install_spec.rb @@ -17,7 +17,7 @@ it { is_expected.to compile.with_all_deps } it { is_expected.to contain_class('openldap::client::install') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' case facts[:os]['release']['major'] when '12', '22.04' diff --git a/spec/classes/openldap_client_spec.rb b/spec/classes/openldap_client_spec.rb index 08ca62a3..eed4466e 100644 --- a/spec/classes/openldap_client_spec.rb +++ b/spec/classes/openldap_client_spec.rb @@ -13,7 +13,7 @@ it { is_expected.to compile.with_all_deps } it { is_expected.to contain_class('openldap::client::install').that_comes_before('Class[openldap::client::config]') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' case facts[:os]['release']['major'] when '12', '22.04' diff --git a/spec/classes/openldap_server_config_spec.rb b/spec/classes/openldap_server_config_spec.rb index aecc181c..3db71ada 100644 --- a/spec/classes/openldap_server_config_spec.rb +++ b/spec/classes/openldap_server_config_spec.rb @@ -18,7 +18,7 @@ end end - next if facts[:osfamily] != 'Debian' + next if facts[:os]['family'] != 'Debian' context "on #{os} with KRB5 conf" do let(:facts) do diff --git a/spec/classes/openldap_server_install_spec.rb b/spec/classes/openldap_server_install_spec.rb index 63cb7db6..e44612cb 100644 --- a/spec/classes/openldap_server_install_spec.rb +++ b/spec/classes/openldap_server_install_spec.rb @@ -13,7 +13,7 @@ it { is_expected.to compile.with_all_deps } it { is_expected.to contain_class('openldap::server::install') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_package('slapd').with(ensure: :installed) diff --git a/spec/classes/openldap_server_service_spec.rb b/spec/classes/openldap_server_service_spec.rb index 4d25a346..0a799bc5 100644 --- a/spec/classes/openldap_server_service_spec.rb +++ b/spec/classes/openldap_server_service_spec.rb @@ -14,7 +14,7 @@ it { is_expected.to compile.with_all_deps } it { is_expected.to contain_class('openldap::server::service') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_service('slapd').with(ensure: :running, diff --git a/spec/classes/openldap_server_slapdconf_spec.rb b/spec/classes/openldap_server_slapdconf_spec.rb index ba8591e7..fa15bcff 100644 --- a/spec/classes/openldap_server_slapdconf_spec.rb +++ b/spec/classes/openldap_server_slapdconf_spec.rb @@ -13,7 +13,7 @@ it { is_expected.to compile.with_all_deps } it { is_expected.to contain_class('openldap::server::slapdconf') } - case facts[:osfamily] + case facts[:os]['family'] when 'RedHat' it { is_expected.to contain_openldap__server__database('dc=my-domain,dc=com').with(ensure: :absent) } else diff --git a/spec/classes/openldap_server_spec.rb b/spec/classes/openldap_server_spec.rb index 84526069..af3de710 100644 --- a/spec/classes/openldap_server_spec.rb +++ b/spec/classes/openldap_server_spec.rb @@ -33,7 +33,7 @@ that_comes_before('Class[openldap::server]') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_class('openldap::server').with(package: 'slapd', diff --git a/spec/classes/openldap_utils_spec.rb b/spec/classes/openldap_utils_spec.rb index e1f8f2e8..0148b7ec 100644 --- a/spec/classes/openldap_utils_spec.rb +++ b/spec/classes/openldap_utils_spec.rb @@ -12,7 +12,7 @@ context 'with no parameters' do it { is_expected.to compile.with_all_deps } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_package('ldap-utils').with(ensure: :installed)