Skip to content

Commit

Permalink
Drop EL7 support
Browse files Browse the repository at this point in the history
  • Loading branch information
ehelms committed Jul 18, 2022
1 parent d372e3d commit 259f038
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 72 deletions.
1 change: 0 additions & 1 deletion manifests/plugin/ostree.pp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# @summary Pulp Ostree plugin
#
# This plugin is not packaged on EL7.
class pulpcore::plugin::ostree {
pulpcore::plugin { 'ostree': }
}
16 changes: 7 additions & 9 deletions manifests/repo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,13 @@
notify => Anchor['pulpcore::repo'],
}

if $facts['os']['release']['major'] != '7' {
package { 'pulpcore-dnf-module':
ensure => $dist_tag,
name => 'pulpcore',
enable_only => true,
provider => 'dnfmodule',
require => File['/etc/yum.repos.d/pulpcore.repo'],
notify => Anchor['pulpcore::repo'],
}
package { 'pulpcore-dnf-module':
ensure => $dist_tag,
name => 'pulpcore',
enable_only => true,
provider => 'dnfmodule',
require => File['/etc/yum.repos.d/pulpcore.repo'],
notify => Anchor['pulpcore::repo'],
}

# An anchor is used because it can be collected
Expand Down
2 changes: 0 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,12 @@
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"7",
"8"
]
},
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"7",
"8"
]
}
Expand Down
7 changes: 1 addition & 6 deletions spec/acceptance/basic_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,7 @@ class { 'pulpcore':
it { is_expected.to be_listening }
end

describe service('rh-redis5-redis'), if: %w[centos redhat].include?(os[:family]) && os[:release].to_i == 7 do
it { is_expected.to be_running }
it { is_expected.to be_enabled }
end

describe service('redis'), unless: %w[centos redhat].include?(os[:family]) && os[:release].to_i == 7 do
describe service('redis') do
it { is_expected.to be_running }
it { is_expected.to be_enabled }
end
Expand Down
12 changes: 2 additions & 10 deletions spec/acceptance/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,14 @@ class { 'pulpcore::cli':
its(:exit_status) { is_expected.to eq 0 }
its(:stdout) { is_expected.to match(/versions/) }
its(:stderr) { is_expected.not_to match(/Error/) }
# currently this contains a warning:
# SubjectAltNameWarning: Certificate for centos7-64.example.com has no `subjectAltName`, falling back to check for a `commonName` for now. This feature is being removed by major browsers and deprecated by RFC 2818.
unless %w[centos redhat].include?(os[:family]) && os[:release].to_i == 7
its(:stderr) { is_expected.to eq '' }
end
its(:stderr) { is_expected.to eq '' }
end

describe command("REQUESTS_CA_BUNDLE=/etc/pulpcore-certs/ca-cert.pem pulp user list") do
its(:exit_status) { is_expected.to eq 0 }
its(:stdout) { is_expected.to match(/admin/) }
its(:stderr) { is_expected.not_to match(/Error/) }
# currently this contains a warning:
# SubjectAltNameWarning: Certificate for centos7-64.example.com has no `subjectAltName`, falling back to check for a `commonName` for now. This feature is being removed by major browsers and deprecated by RFC 2818.
unless %w[centos redhat].include?(os[:family]) && os[:release].to_i == 7
its(:stderr) { is_expected.to eq '' }
end
its(:stderr) { is_expected.to eq '' }
end
end

Expand Down
11 changes: 0 additions & 11 deletions spec/acceptance/hieradata/os/RedHat/7.yaml

This file was deleted.

20 changes: 8 additions & 12 deletions spec/classes/repo_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,14 @@
.that_notifies('Anchor[pulpcore::repo]')
end

it 'configures the pulpcore module on EL8' do
if os_facts[:os]['release']['major'] == '7'
is_expected.not_to contain_package('pulpcore-dnf-module')
else
is_expected.to contain_package('pulpcore-dnf-module')
.with_name('pulpcore')
.with_ensure(/^el\d+/)
.with_enable_only(true)
.with_provider('dnfmodule')
.that_requires('File[/etc/yum.repos.d/pulpcore.repo]')
.that_notifies('Anchor[pulpcore::repo]')
end
it 'configures the pulpcore module' do
is_expected.to contain_package('pulpcore-dnf-module')
.with_name('pulpcore')
.with_ensure(/^el\d+/)
.with_enable_only(true)
.with_provider('dnfmodule')
.that_requires('File[/etc/yum.repos.d/pulpcore.repo]')
.that_notifies('Anchor[pulpcore::repo]')
end
end
end
Expand Down
21 changes: 1 addition & 20 deletions spec/setup_acceptance_node.pp
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
$major = $facts['os']['release']['major']

case $major {
'7': {
package { 'centos-release-scl-rh':
ensure => installed,
}

package { 'epel-release':
ensure => installed,
}

package { 'rh-redis5-redis':
ensure => installed,
require => Package['centos-release-scl-rh'],
}
}
'8': {
package { 'glibc-langpack-en':
ensure => installed,
Expand Down Expand Up @@ -45,12 +31,7 @@
$client_cert = "${directory}/client-cert.pem"
$client_key = "${directory}/client-key.pem"

# EL7 lacks openssl -addext
if $facts['os']['release']['major'] == '7' {
$ca_cmd = "openssl req -nodes -x509 -newkey rsa:2048 -subj '/CN=${facts['networking']['fqdn']}' -keyout '${ca_key}' -out '${ca_cert}' -days 365"
} else {
$ca_cmd = "openssl req -nodes -x509 -newkey rsa:2048 -subj '/CN=${facts['networking']['fqdn']}' -addext 'subjectAltName = DNS:${facts['networking']['fqdn']}' -keyout '${ca_key}' -out '${ca_cert}' -days 365"
}
$ca_cmd = "openssl req -nodes -x509 -newkey rsa:2048 -subj '/CN=${facts['networking']['fqdn']}' -addext 'subjectAltName = DNS:${facts['networking']['fqdn']}' -keyout '${ca_key}' -out '${ca_cert}' -days 365"

exec { 'Create certificate directory':
command => "mkdir -p ${directory}",
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'voxpupuli/acceptance/spec_helper_acceptance'

ENV['BEAKER_setfile'] ||= 'centos7-64{hostname=centos7-64.example.com}'
ENV['BEAKER_setfile'] ||= 'centos8-64{hostname=centos8-64.example.com}'

configure_beaker(modules: :fixtures) do |host|
if fact_on(host, 'os.family') == 'RedHat'
Expand Down

0 comments on commit 259f038

Please sign in to comment.