Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for an outsider package on RHEL8+ #429

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions manifests/server/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,16 @@
value => $slapd_ldap_urls,
}
}
if versioncmp($facts['os']['release']['major'], '8') >= 0 {
systemd::dropin_file { 'puppet.conf':
unit => "${openldap::server::service}.service",
content => join([
'[Service]',
'EnvironmentFile=/etc/sysconfig/slapd',
'ExecStart=',
"ExecStart=/usr/sbin/slapd -u ${openldap::server::owner} -h \${SLAPD_URLS} \$SLAPD_OPTIONS",
], "\n"),
if versioncmp($facts['os']['release']['major'], '8') >= 0 and $openldap::server::package == 'openldap-servers' {
systemd::manage_dropin { 'puppet.conf':
unit => "${openldap::server::service}.service",
service_entry => {
'EnvironmentFile' => '/etc/sysconfig/slapd',
'ExecStart' => [
'',
"/usr/sbin/slapd -u ${openldap::server::owner} -h \${SLAPD_URLS} \$SLAPD_OPTIONS",
],
},
}
}
}
Expand Down
22 changes: 22 additions & 0 deletions spec/classes/openldap_server_config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
it { is_expected.not_to contain_openldap__globalconf('TLSCertificateFile') }
it { is_expected.not_to contain_openldap__globalconf('TLSCertificateKeyFile') }
it { is_expected.not_to contain_openldap__globalconf('TLSCACertificateFile') }

if (facts[:os]['family'] == 'RedHat') && (facts[:os]['release']['major'].to_i >= 8)
it { is_expected.to contain_systemd__dropin_file('puppet.conf') }
else
it { is_expected.not_to contain_systemd__dropin_file('puppet.conf') }
end
end
end

Expand All @@ -35,5 +41,21 @@
it { is_expected.to contain_shellvar('krb5_client_ktname').with(value: '/etc/krb5.keytab') }
end
end

context "on #{os} with nonstandard package" do
let(:facts) do
facts
end

let(:pre_condition) do
"class {'openldap::server': package => 'some-openldap-clone', }"
end

context 'with some-openldap-clone' do
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_class('openldap::server::config') }
it { is_expected.not_to contain_systemd__dropin_file('puppet.conf') }
end
end
end
end
Loading