Skip to content

Commit

Permalink
Add EL9 support
Browse files Browse the repository at this point in the history
  • Loading branch information
treydock committed Apr 11, 2023
1 parent 2822e76 commit 667e1af
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ fixtures:
augeasproviders_shellvar: 'https://github.com/voxpupuli/puppet-augeasproviders_shellvar.git'
augeasproviders_core: 'https://github.com/voxpupuli/puppet-augeasproviders_core.git'
systemd: 'https://github.com/voxpupuli/puppet-systemd.git'
epel: 'https://github.com/voxpupuli/puppet-epel.git'
yumrepo_core: 'https://github.com/puppetlabs/puppetlabs-yumrepo_core.git'
augeas_core: 'https://github.com/puppetlabs/puppetlabs-augeas_core.git'
facts: 'https://github.com/puppetlabs/puppetlabs-facts.git'
puppet_agent: 'https://github.com/puppetlabs/puppetlabs-puppet_agent.git'
Expand Down
1 change: 1 addition & 0 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
Boolean $escape_ldapi_ifs,
Array[String[1]] $ldapi_ifs,
Stdlib::Absolutepath $default_directory,
Boolean $manage_repo = true,
Optional[Boolean] $enable_chown = undef,
Optional[Boolean] $service_hasstatus = undef,
Boolean $enable = true,
Expand Down
7 changes: 7 additions & 0 deletions manifests/server/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@
$responsefile = undef
}

if $facts['os']['family'] == 'RedHat' and versioncmp($facts['os']['release']['major'], '9') >= 0 {
if $openldap::server::manage_repo {
include epel
Class['epel'] -> Package[$openldap::server::package]
}
}

package { $openldap::server::package:
ensure => present,
responsefile => $responsefile,
Expand Down
21 changes: 17 additions & 4 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
"name": "puppetlabs/augeas_core",
"version_requirement": ">= 1.0.0 < 2.0.0"
},
{
"name": "puppetlabs/yumrepo_core",
"version_requirement": ">= 1.0.0 < 2.0.0"
},
{
"name": "puppet/augeasproviders_core",
"version_requirement": ">= 2.0.0 < 4.0.0"
Expand All @@ -27,6 +31,10 @@
{
"name": "puppet/systemd",
"version_requirement": ">= 3.0.0 < 5.0.0"
},
{
"name": "puppet/epel",
"version_requirement": ">= 4.1.0 < 5.0.0"
}
],
"operatingsystem_support": [
Expand Down Expand Up @@ -61,25 +69,30 @@
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"7",
"8"
"8",
"9"
]
},
{
"operatingsystem": "AlmaLinux",
"operatingsystemrelease": [
"8"
"8",
"9"
]
},
{
"operatingsystem": "Rocky",
"operatingsystemrelease": [
"8"
"8",
"9"
]
},
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"7"
"7",
"8",
"9"
]
},
{
Expand Down
12 changes: 12 additions & 0 deletions spec/classes/openldap_server_install_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@
is_expected.to contain_package('openldap-servers').with(ensure: :present)
}
end

if (facts[:os]['family'] == 'RedHat') && (facts[:os]['release']['major'].to_s == '9')
it { is_expected.to contain_class('epel').that_comes_before('Package[openldap-servers]') }
else
it { is_expected.not_to contain_class('epel') }
end

context 'when manage_repo => false' do
let(:params) { { manage_repo: false } }

it { is_expected.not_to contain_class('epel') } if (facts[:os]['family'] == 'RedHat') && (facts[:os]['release']['major'].to_s == '9')

Check failure on line 36 in spec/classes/openldap_server_install_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

openldap::server::install on centos-9-x86_64 with no parameters when manage_repo => false is expected not to contain Class[epel] Failure/Error: it { is_expected.not_to contain_class('epel') } if (facts[:os]['family'] == 'RedHat') && (facts[:os]['release']['major'].to_s == '9') Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Class[Openldap::Server::Install]: has no parameter named 'manage_repo' (line: 2, column: 1) on node fv-az167-97.10vc1fp43w4ejfym3u1nh0imhc.jx.internal.cloudapp.net

Check failure on line 36 in spec/classes/openldap_server_install_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

openldap::server::install on rocky-9-x86_64 with no parameters when manage_repo => false is expected not to contain Class[epel] Failure/Error: it { is_expected.not_to contain_class('epel') } if (facts[:os]['family'] == 'RedHat') && (facts[:os]['release']['major'].to_s == '9') Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Class[Openldap::Server::Install]: has no parameter named 'manage_repo' (line: 2, column: 1) on node fv-az167-97.10vc1fp43w4ejfym3u1nh0imhc.jx.internal.cloudapp.net

Check failure on line 36 in spec/classes/openldap_server_install_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

openldap::server::install on almalinux-9-x86_64 with no parameters when manage_repo => false is expected not to contain Class[epel] Failure/Error: it { is_expected.not_to contain_class('epel') } if (facts[:os]['family'] == 'RedHat') && (facts[:os]['release']['major'].to_s == '9') Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Class[Openldap::Server::Install]: has no parameter named 'manage_repo' (line: 2, column: 1) on node fv-az167-97.10vc1fp43w4ejfym3u1nh0imhc.jx.internal.cloudapp.net

Check failure on line 36 in spec/classes/openldap_server_install_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

openldap::server::install on redhat-9-x86_64 with no parameters when manage_repo => false is expected not to contain Class[epel] Failure/Error: it { is_expected.not_to contain_class('epel') } if (facts[:os]['family'] == 'RedHat') && (facts[:os]['release']['major'].to_s == '9') Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Class[Openldap::Server::Install]: has no parameter named 'manage_repo' (line: 2, column: 1) on node fv-az167-97.10vc1fp43w4ejfym3u1nh0imhc.jx.internal.cloudapp.net

Check failure on line 36 in spec/classes/openldap_server_install_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 6 (Ruby 2.5)

openldap::server::install on centos-9-x86_64 with no parameters when manage_repo => false is expected not to contain Class[epel] Failure/Error: it { is_expected.not_to contain_class('epel') } if (facts[:os]['family'] == 'RedHat') && (facts[:os]['release']['major'].to_s == '9') Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Class[Openldap::Server::Install]: has no parameter named 'manage_repo' (line: 2, column: 1) on node fv-az168-189.at4b0qtlrlvulo0jylzcs2p0yb.jx.internal.cloudapp.net

Check failure on line 36 in spec/classes/openldap_server_install_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 6 (Ruby 2.5)

openldap::server::install on rocky-9-x86_64 with no parameters when manage_repo => false is expected not to contain Class[epel] Failure/Error: it { is_expected.not_to contain_class('epel') } if (facts[:os]['family'] == 'RedHat') && (facts[:os]['release']['major'].to_s == '9') Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Class[Openldap::Server::Install]: has no parameter named 'manage_repo' (line: 2, column: 1) on node fv-az168-189.at4b0qtlrlvulo0jylzcs2p0yb.jx.internal.cloudapp.net

Check failure on line 36 in spec/classes/openldap_server_install_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 6 (Ruby 2.5)

openldap::server::install on almalinux-9-x86_64 with no parameters when manage_repo => false is expected not to contain Class[epel] Failure/Error: it { is_expected.not_to contain_class('epel') } if (facts[:os]['family'] == 'RedHat') && (facts[:os]['release']['major'].to_s == '9') Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Class[Openldap::Server::Install]: has no parameter named 'manage_repo' (line: 2, column: 1) on node fv-az168-189.at4b0qtlrlvulo0jylzcs2p0yb.jx.internal.cloudapp.net

Check failure on line 36 in spec/classes/openldap_server_install_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 6 (Ruby 2.5)

openldap::server::install on redhat-9-x86_64 with no parameters when manage_repo => false is expected not to contain Class[epel] Failure/Error: it { is_expected.not_to contain_class('epel') } if (facts[:os]['family'] == 'RedHat') && (facts[:os]['release']['major'].to_s == '9') Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Class[Openldap::Server::Install]: has no parameter named 'manage_repo' (line: 2, column: 1) on node fv-az168-189.at4b0qtlrlvulo0jylzcs2p0yb.jx.internal.cloudapp.net
end
end
end
end
Expand Down

0 comments on commit 667e1af

Please sign in to comment.