Skip to content

Commit

Permalink
Get rid of the osfamily legacy fact
Browse files Browse the repository at this point in the history
  • Loading branch information
smortex committed Aug 13, 2024
1 parent eda9ab0 commit 423a96d
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 41 deletions.
66 changes: 33 additions & 33 deletions spec/classes/openldap_client_config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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({
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand All @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/openldap_client_install_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/openldap_client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/openldap_server_config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/openldap_server_install_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/openldap_server_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/openldap_server_slapdconf_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/openldap_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/openldap_utils_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 423a96d

Please sign in to comment.