Skip to content

Commit c9ee25c

Browse files
authored
Merge pull request voxpupuli#509 from ekohl/drop-el7-for-real
Drop EL7 compatibility code
2 parents 4641887 + a8c7827 commit c9ee25c

File tree

8 files changed

+27
-158
lines changed

8 files changed

+27
-158
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class { 'redis':
111111
}
112112
```
113113

114-
**Warning** note that PPA usage requires [puppetlabs/apt](https://forge.puppet.com/puppetlabs/apt) on Ubuntu distros. On EL7 [puppet/epel](https://forge.puppet.com/puppet/epel) is needed unless the installation is using Software Collections. In that case will install `centos-release-scl-rh` from CentOS extras. For RHEL or other RHEL-derivatives this isn't managed.
114+
**Warning** note that PPA usage requires [puppetlabs/apt](https://forge.puppet.com/puppetlabs/apt) on Ubuntu distros
115115

116116
### Redis Sentinel
117117

@@ -135,7 +135,7 @@ class { 'redis::sentinel':
135135

136136
### Soft dependency
137137

138-
When managing the repo, it either needs [puppetlabs/apt](https://forge.puppet.com/puppetlabs/apt) or [puppet/epel](https://forge.puppet.com/puppet/epel).
138+
When managing the repo, it needs [puppetlabs/apt](https://forge.puppet.com/puppetlabs/apt).
139139

140140
For administration of sysctl it depends on [herculesteam/augeasproviders_sysctl](https://forge.puppet.com/herculesteam/augeasproviders_sysctl).
141141

REFERENCE.md

-19
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
* [`redis`](#redis): This class installs redis
1212
* [`redis::administration`](#redis--administration): Allows various administrative settings for Redis
13-
* [`redis::globals`](#redis--globals): Set a global config for Redis
1413
* [`redis::sentinel`](#redis--sentinel): Install redis-sentinel
1514

1615
#### Private Classes
@@ -1489,24 +1488,6 @@ Set somaxconn value
14891488

14901489
Default value: `65535`
14911490

1492-
### <a name="redis--globals"></a>`redis::globals`
1493-
1494-
Set a global config for Redis
1495-
1496-
#### Parameters
1497-
1498-
The following parameters are available in the `redis::globals` class:
1499-
1500-
* [`scl`](#-redis--globals--scl)
1501-
1502-
##### <a name="-redis--globals--scl"></a>`scl`
1503-
1504-
Data type: `Optional[String]`
1505-
1506-
Use a specific Software Collection on Red Hat 7 based systems
1507-
1508-
Default value: `undef`
1509-
15101491
### <a name="redis--sentinel"></a>`redis::sentinel`
15111492

15121493
Install redis-sentinel

manifests/globals.pp

-11
This file was deleted.

manifests/params.pp

+24-44
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# @summary This class provides a number of parameters.
22
# @api private
3-
class redis::params inherits redis::globals {
3+
class redis::params {
44
case $facts['os']['family'] {
55
'Debian': {
66
$config_dir = '/etc/redis'
@@ -47,51 +47,31 @@
4747
$sentinel_daemonize = false
4848
$sentinel_working_dir = '/tmp'
4949

50-
$scl = $redis::globals::scl
51-
if $scl {
52-
$config_dir = "/etc/opt/rh/${scl}"
53-
$config_file = "/etc/opt/rh/${scl}/redis.conf"
54-
$config_file_orig = "/etc/opt/rh/${scl}/redis.conf.puppet"
55-
$log_dir = "/var/opt/rh/${scl}/log/redis"
56-
$package_name = "${scl}-redis"
57-
$pid_file = "/var/opt/rh/${scl}/run/redis_6379.pid"
58-
$service_name = "${scl}-redis"
59-
$workdir = "/var/opt/rh/${scl}/lib/redis"
60-
$bin_path = "/opt/rh/${scl}/root/usr/bin"
61-
62-
$sentinel_config_file = "${config_dir}/redis-sentinel.conf"
63-
$sentinel_config_file_orig = "${config_dir}/redis-sentinel.conf.puppet"
64-
$sentinel_service_name = "${scl}-redis-sentinel"
65-
$sentinel_package_name = $package_name
66-
$sentinel_pid_file = "/var/opt/rh/${scl}/run/redis-sentinel.pid"
67-
$sentinel_log_file = "/var/opt/rh/${scl}/log/redis/sentinel.log"
50+
$config_dir = '/etc/redis'
51+
if (versioncmp($facts['os']['release']['major'], '9') >= 0) {
52+
$config_file = '/etc/redis/redis.conf'
53+
$config_file_orig = '/etc/redis/redis.conf.puppet'
6854
} else {
69-
$config_dir = '/etc/redis'
70-
if (versioncmp($facts['os']['release']['major'], '9') >= 0) {
71-
$config_file = '/etc/redis/redis.conf'
72-
$config_file_orig = '/etc/redis/redis.conf.puppet'
73-
} else {
74-
$config_file = '/etc/redis.conf'
75-
$config_file_orig = '/etc/redis.conf.puppet'
76-
}
77-
$log_dir = '/var/log/redis'
78-
$package_name = 'redis'
79-
$pid_file = '/var/run/redis_6379.pid'
80-
$service_name = 'redis'
81-
$workdir = '/var/lib/redis'
82-
$bin_path = '/usr/bin'
83-
if (versioncmp($facts['os']['release']['major'], '9') >= 0) {
84-
$sentinel_config_file = '/etc/redis/sentinel.conf'
85-
$sentinel_config_file_orig = '/etc/redis/sentinel.conf.puppet'
86-
} else {
87-
$sentinel_config_file = '/etc/redis-sentinel.conf'
88-
$sentinel_config_file_orig = '/etc/redis-sentinel.conf.puppet'
89-
}
90-
$sentinel_service_name = 'redis-sentinel'
91-
$sentinel_package_name = 'redis'
92-
$sentinel_pid_file = '/var/run/redis/redis-sentinel.pid'
93-
$sentinel_log_file = '/var/log/redis/sentinel.log'
55+
$config_file = '/etc/redis.conf'
56+
$config_file_orig = '/etc/redis.conf.puppet'
57+
}
58+
$log_dir = '/var/log/redis'
59+
$package_name = 'redis'
60+
$pid_file = '/var/run/redis_6379.pid'
61+
$service_name = 'redis'
62+
$workdir = '/var/lib/redis'
63+
$bin_path = '/usr/bin'
64+
if (versioncmp($facts['os']['release']['major'], '9') >= 0) {
65+
$sentinel_config_file = '/etc/redis/sentinel.conf'
66+
$sentinel_config_file_orig = '/etc/redis/sentinel.conf.puppet'
67+
} else {
68+
$sentinel_config_file = '/etc/redis-sentinel.conf'
69+
$sentinel_config_file_orig = '/etc/redis-sentinel.conf.puppet'
9470
}
71+
$sentinel_service_name = 'redis-sentinel'
72+
$sentinel_package_name = 'redis'
73+
$sentinel_pid_file = '/var/run/redis/redis-sentinel.pid'
74+
$sentinel_log_file = '/var/log/redis/sentinel.log'
9575
}
9676

9777
'FreeBSD': {

manifests/preinstall.pp

+1-10
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,7 @@
33
# @api private
44
class redis::preinstall {
55
if $redis::manage_repo {
6-
if $facts['os']['family'] == 'RedHat' and versioncmp($facts['os']['release']['major'], '7') <= 0 {
7-
if $redis::scl {
8-
if $facts['os']['name'] == 'CentOS' {
9-
ensure_packages(['centos-release-scl-rh'])
10-
Package['centos-release-scl-rh'] -> Package[$redis::package_name]
11-
}
12-
} else {
13-
require 'epel'
14-
}
15-
} elsif $facts['os']['name'] == 'Ubuntu' and $redis::ppa_repo {
6+
if $facts['os']['name'] == 'Ubuntu' and $redis::ppa_repo {
167
contain 'apt'
178
apt::ppa { $redis::ppa_repo: }
189
} elsif $facts['os']['family'] == 'Debian' and $redis::redis_apt_repo {

spec/acceptance/suites/scl/redis5_spec.rb

-34
This file was deleted.

spec/classes/redis_spec.rb

-37
Original file line numberDiff line numberDiff line change
@@ -51,37 +51,6 @@
5151

5252
it { is_expected.to contain_service(service_name).with_ensure('running').with_enable('true') }
5353

54-
context 'with SCL', if: facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'].to_i < 8 do
55-
let(:pre_condition) do
56-
<<-PUPPET
57-
class { 'redis::globals':
58-
scl => 'rh-redis5',
59-
}
60-
PUPPET
61-
end
62-
63-
it { is_expected.to compile.with_all_deps }
64-
65-
it do
66-
is_expected.to create_class('redis').
67-
with_package_name('rh-redis5-redis').
68-
with_config_file('/etc/opt/rh/rh-redis5/redis.conf').
69-
with_service_name('rh-redis5-redis')
70-
end
71-
72-
context 'manage_repo => true' do
73-
let(:params) { { manage_repo: true } }
74-
75-
it { is_expected.to compile.with_all_deps }
76-
77-
if facts[:os]['name'] == 'CentOS'
78-
it { is_expected.to contain_package('centos-release-scl-rh') }
79-
else
80-
it { is_expected.not_to contain_package('centos-release-scl-rh') }
81-
end
82-
end
83-
end
84-
8554
describe 'with manage_dnf_module true', if: facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'].to_i == 8 do
8655
let(:pre_condition) do
8756
<<-PUPPET
@@ -501,12 +470,6 @@ class { 'redis':
501470
describe 'with parameter: manage_repo' do
502471
let(:params) { { manage_repo: true } }
503472

504-
if facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'].to_i <= 7
505-
it { is_expected.to contain_class('epel') }
506-
else
507-
it { is_expected.not_to contain_class('epel') }
508-
end
509-
510473
describe 'with ppa' do
511474
let(:params) { super().merge(ppa_repo: 'ppa:rwky/redis') }
512475

spec/spec_helper_acceptance.rb

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
configure_beaker do |host|
66
# sysctl is untestable in docker
77
install_puppet_module_via_pmt_on(host, 'puppet-augeasproviders_sysctl') unless host['hypervisor'] == 'docker'
8-
install_puppet_module_via_pmt_on(host, 'puppet-epel') if fact_on(host, 'os.family') == 'RedHat' && fact_on(host, 'os.release.major').to_i == 7
98

109
unless fact_on(host, 'os.family') == 'RedHat' && fact_on(host, 'os.release.major').to_i >= 9
1110
# puppet-bolt rpm for CentOS 9 is not yet available

0 commit comments

Comments
 (0)