diff --git a/lib/puppet/provider/openldap_access/olc.rb b/lib/puppet/provider/openldap_access/olc.rb index cd83ada5..1aa586de 100644 --- a/lib/puppet/provider/openldap_access/olc.rb +++ b/lib/puppet/provider/openldap_access/olc.rb @@ -11,7 +11,7 @@ provide(:olc, parent: Puppet::Provider::Openldap) do # TODO: Use ruby bindings (can't find one that support IPC) - defaultfor osfamily: %i[debian freebsd redhat suse] + defaultfor 'os.family' => %i[debian freebsd redhat suse] mk_resource_methods diff --git a/lib/puppet/provider/openldap_database/olc.rb b/lib/puppet/provider/openldap_database/olc.rb index de46b562..46590316 100644 --- a/lib/puppet/provider/openldap_database/olc.rb +++ b/lib/puppet/provider/openldap_database/olc.rb @@ -8,7 +8,7 @@ provide(:olc, parent: Puppet::Provider::Openldap) do # TODO: Use ruby bindings (can't find one that support IPC) - defaultfor osfamily: %i[debian freebsd redhat suse] + defaultfor 'os.family' => %i[debian freebsd redhat suse] mk_resource_methods diff --git a/lib/puppet/provider/openldap_dbindex/olc.rb b/lib/puppet/provider/openldap_dbindex/olc.rb index de66bf3e..ebcbb6db 100644 --- a/lib/puppet/provider/openldap_dbindex/olc.rb +++ b/lib/puppet/provider/openldap_dbindex/olc.rb @@ -10,7 +10,7 @@ provide(:olc, parent: Puppet::Provider::Openldap) do # TODO: Use ruby bindings (can't find one that support IPC) - defaultfor osfamily: %i[debian freebsd redhat suse] + defaultfor 'os.family' => %i[debian freebsd redhat suse] mk_resource_methods diff --git a/lib/puppet/provider/openldap_global_conf/olc.rb b/lib/puppet/provider/openldap_global_conf/olc.rb index be528fc4..09ec1576 100644 --- a/lib/puppet/provider/openldap_global_conf/olc.rb +++ b/lib/puppet/provider/openldap_global_conf/olc.rb @@ -8,7 +8,7 @@ provide(:olc, parent: Puppet::Provider::Openldap) do # TODO: Use ruby bindings (can't find one that support IPC) - defaultfor osfamily: %i[debian freebsd redhat suse] + defaultfor 'os.family' => %i[debian freebsd redhat suse] mk_resource_methods diff --git a/lib/puppet/provider/openldap_module/olc.rb b/lib/puppet/provider/openldap_module/olc.rb index 1787a410..773d0665 100644 --- a/lib/puppet/provider/openldap_module/olc.rb +++ b/lib/puppet/provider/openldap_module/olc.rb @@ -7,7 +7,7 @@ provide(:olc, parent: Puppet::Provider::Openldap) do # TODO: Use ruby bindings (can't find one that support IPC) - defaultfor osfamily: %i[debian freebsd redhat suse] + defaultfor 'os.family' => %i[debian freebsd redhat suse] mk_resource_methods diff --git a/lib/puppet/provider/openldap_overlay/olc.rb b/lib/puppet/provider/openldap_overlay/olc.rb index 26cc007f..88414f34 100644 --- a/lib/puppet/provider/openldap_overlay/olc.rb +++ b/lib/puppet/provider/openldap_overlay/olc.rb @@ -10,7 +10,7 @@ provide(:olc, parent: Puppet::Provider::Openldap) do # TODO: Use ruby bindings (can't find one that support IPC) - defaultfor osfamily: %i[debian freebsd redhat suse] + defaultfor 'os.family' => %i[debian freebsd redhat suse] mk_resource_methods diff --git a/lib/puppet/provider/openldap_schema/olc.rb b/lib/puppet/provider/openldap_schema/olc.rb index 32127344..5819b91d 100644 --- a/lib/puppet/provider/openldap_schema/olc.rb +++ b/lib/puppet/provider/openldap_schema/olc.rb @@ -12,7 +12,7 @@ provide(:olc, parent: Puppet::Provider::Openldap) do # TODO: Use ruby bindings (can't find one that support IPC) - defaultfor osfamily: %i[debian freebsd redhat suse] + defaultfor 'os.family' => %i[debian freebsd redhat suse] mk_resource_methods diff --git a/lib/puppet/type/openldap_database.rb b/lib/puppet/type/openldap_database.rb index e55bc010..550a014f 100644 --- a/lib/puppet/type/openldap_database.rb +++ b/lib/puppet/type/openldap_database.rb @@ -29,17 +29,17 @@ desc 'The name of the backend.' newvalues('bdb', 'hdb', 'mdb', 'monitor', 'config', 'relay', 'ldap') defaultto do - case Facter.value(:osfamily) + case Facter.value('os.family') when 'Debian' - case Facter.value(:operatingsystem) + case Facter.value('os.name') when 'Debian' - if Facter.value(:operatingsystemmajrelease).to_i <= 7 + if Facter.value('os.release.major').to_i <= 7 'hdb' else 'mdb' end when 'Ubuntu' - if Facter.value(:operatingsystemmajrelease).to_i <= 15 + if Facter.value('os.release.major').to_i <= 15 'hdb' else 'mdb' @@ -48,9 +48,9 @@ 'hdb' end when 'RedHat' - if Facter.value(:operatingsystemmajrelease).to_i <= 6 + if Facter.value('os.release.major').to_i <= 6 'bdb' - elsif Facter.value(:os).dig('release', 'major').to_i >= 9 + elsif Facter.value('os.release.major').to_i >= 9 'mdb' else 'hdb' 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)