Skip to content

Commit 62696b7

Browse files
authored
Merge pull request voxpupuli#208 from traylenator/seven
Drop Support for EOL OSes
2 parents 4e6cb0c + 043b0ba commit 62696b7

File tree

7 files changed

+40
-199
lines changed

7 files changed

+40
-199
lines changed

files/cvmfs_fsck.logrotate

Lines changed: 0 additions & 9 deletions
This file was deleted.

manifests/config.pp

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -169,27 +169,12 @@
169169
}
170170

171171
if $mount_method == 'autofs' {
172-
if ($facts['os']['family'] == 'RedHat' and versioncmp($facts['os']['release']['major'],'7') <= 0 ) or
173-
($facts['os']['name'] == 'Ubuntu' and $facts['os']['release']['major'] == '18.04') {
174-
augeas { 'cvmfs_automaster':
175-
context => '/files/etc/auto.master/',
176-
lens => 'Automaster.lns',
177-
incl => '/etc/auto.master',
178-
changes => [
179-
'set 01 /cvmfs',
180-
'set 01/type program',
181-
'set 01/map /etc/auto.cvmfs',
182-
],
183-
onlyif => 'match *[map="/etc/auto.cvmfs"] size == 0',
184-
}
185-
} else {
186-
file { '/etc/auto.master.d/cvmfs.autofs':
187-
ensure => file,
188-
content => "# Puppet installed\n/cvmfs program:/etc/auto.cvmfs\n",
189-
owner => root,
190-
group => root,
191-
mode => '0644',
192-
}
172+
file { '/etc/auto.master.d/cvmfs.autofs':
173+
ensure => file,
174+
content => "# Puppet installed\n/cvmfs program:/etc/auto.cvmfs\n",
175+
owner => root,
176+
group => root,
177+
mode => '0644',
193178
}
194179
}
195180
}

manifests/fsck.pp

Lines changed: 15 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -5,93 +5,28 @@
55
# @param cvmfs_cache_base Root of cvmfs cache
66
# @param options Any extra options
77
# @param onreboot Should fsck be run after every reboot
8-
# @param usesystemd Use a systemd timer
98
#
109
class cvmfs::fsck (
1110
Stdlib::Absolutepath $cvmfs_cache_base = $cvmfs::cvmfs_cache_base,
1211
Optional[String] $options = $cvmfs::cvmfs_fsck_options,
1312
Boolean $onreboot = $cvmfs::cvmfs_fsck_onreboot,
14-
Optional[Boolean] $usesystemd = undef,
1513
) inherits cvmfs {
16-
if ($facts['os']['family'] == 'RedHat' and (versioncmp($facts['os']['release']['major'],'7') <= 0))
17-
or ($facts['os']['name'] == 'Debian' and (versioncmp($facts['os']['release']['major'],'9') <= 0))
18-
or ($facts['os']['name'] == 'Ubuntu' and (versioncmp($facts['os']['release']['major'],'16') <= 0)) {
19-
$_usesystemd = false
20-
} else {
21-
$_usesystemd = true
14+
systemd::timer { 'cvmfs-fsck.timer':
15+
service_content => epp('cvmfs/fsck/cvmfs-fsck.service.epp',
16+
{
17+
'cache_base' => $cvmfs_cache_base,
18+
'options' => $options,
19+
}),
20+
timer_content => epp('cvmfs/fsck/cvmfs-fsck.timer.epp',
21+
{
22+
'onreboot' => $onreboot,
23+
}),
24+
enable => true,
25+
active => true,
2226
}
2327

24-
if $_usesystemd {
25-
systemd::timer { 'cvmfs-fsck.timer':
26-
service_content => epp('cvmfs/fsck/cvmfs-fsck.service.epp',
27-
{
28-
'cache_base' => $cvmfs_cache_base,
29-
'options' => $options,
30-
}),
31-
timer_content => epp('cvmfs/fsck/cvmfs-fsck.timer.epp',
32-
{
33-
'onreboot' => $onreboot,
34-
}),
35-
enable => true,
36-
active => true,
37-
}
38-
39-
# This removal of a now redundant can be removed at some future date
40-
systemd::tmpfile { 'cvmfs-quarantaine.conf':
41-
ensure => absent,
42-
}
43-
} else {
44-
file { '/usr/local/sbin/cvmfs_fsck_cron.sh':
45-
ensure => file,
46-
mode => '0744',
47-
owner => root,
48-
group => root,
49-
content => template('cvmfs/cvmfs_fsck_cron.sh.erb'),
50-
}
51-
# -i <value> flag to script says cron job will exit early if uptime is less than this value.
52-
53-
$tmpcleaning_cmd = $facts['os']['family'] ? {
54-
'RedHat' => '/usr/sbin/tmpwatch -umc -f 30d',
55-
'Debian' => '/usr/sbin/tmpreaper -m -f 30d',
56-
default => '/usr/sbin/tmpwatch -umc -f 30d',
57-
}
58-
59-
$tmpcleaning_pkg = $facts['os']['family'] ? {
60-
'RedHat' => 'tmpwatch',
61-
'Debian' => 'tmpreaper',
62-
default => 'tmpwatch',
63-
}
64-
# Provides ionice.
65-
$util_linux_pkg = 'util-linux'
66-
67-
cron { 'clean_quarantaine':
68-
hour => fqdn_rand(24,'cvmfs_purge'),
69-
minute => fqdn_rand(60,'cvmfs_purge'),
70-
weekday => fqdn_rand(7,'cvmfs_purge'),
71-
command => "/usr/bin/test -d ${cvmfs_cache_base}/shared/quarantaine && ${tmpcleaning_cmd} ${cvmfs_cache_base}/shared/quarantaine",
72-
}
73-
74-
cron { 'cvmfs_fsck':
75-
hour => fqdn_rand(24,'cvmfs'),
76-
minute => fqdn_rand(60,'cvmfs'),
77-
weekday => fqdn_rand(7,'cvmfs'),
78-
command => '/usr/local/sbin/cvmfs_fsck_cron.sh -i 86400 2>&1 | /usr/bin/awk \'{ print strftime("\%Y-\%m-\%d \%H:\%M:\%S"), $0; }\' >> /var/log/cvmfs_fsck.log',
79-
require => [File['/usr/local/sbin/cvmfs_fsck_cron.sh'],Package[$tmpcleaning_pkg],Package[$util_linux_pkg]],
80-
}
81-
if $onreboot {
82-
cron { 'cvmfs_fsck_on_reboot':
83-
command => '/usr/local/sbin/cvmfs_fsck_cron.sh -i 0 2>&1 | /usr/bin/awk \'{ print strftime("\%Y-\%m-\%d \%H:\%M:\%S"), $0; }\' >> /var/log/cvmfs_fsck.log',
84-
special => 'reboot',
85-
require => [File['/usr/local/sbin/cvmfs_fsck_cron.sh'],Package[$tmpcleaning_pkg],Package[$util_linux_pkg]],
86-
}
87-
}
88-
file { '/etc/logrotate.d/cvmfs_fsck':
89-
ensure => file,
90-
mode => '0644',
91-
owner => 'root',
92-
group => 'root',
93-
source => 'puppet:///modules/cvmfs/cvmfs_fsck.logrotate',
94-
}
95-
ensure_packages([$tmpcleaning_pkg, $util_linux_pkg])
28+
# This removal of a now redundant can be removed at some future date
29+
systemd::tmpfile { 'cvmfs-quarantaine.conf':
30+
ensure => absent,
9631
}
9732
}

metadata.json

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,19 @@
2828
{
2929
"operatingsystem": "Debian",
3030
"operatingsystemrelease": [
31-
"10",
3231
"11"
3332
]
3433
},
3534
{
3635
"operatingsystem": "Ubuntu",
3736
"operatingsystemrelease": [
38-
"18.04",
3937
"20.04",
4038
"22.04"
4139
]
4240
},
4341
{
4442
"operatingsystem": "RedHat",
4543
"operatingsystemrelease": [
46-
"7",
4744
"8",
4845
"9"
4946
]
@@ -65,16 +62,8 @@
6562
{
6663
"operatingsystem": "CentOS",
6764
"operatingsystemrelease": [
68-
"7",
69-
"8",
7065
"9"
7166
]
72-
},
73-
{
74-
"operatingsystem": "Scientific",
75-
"operatingsystemrelease": [
76-
"7"
77-
]
7867
}
7968
],
8069
"requirements": [

spec/classes/fsck_spec.rb

Lines changed: 17 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,19 @@
1616
it { is_expected.to compile.with_all_deps }
1717
it { is_expected.not_to contain_cron('cvmfs_fsck_on_reboot') }
1818

19-
case facts[:os]['release']['major']
20-
when '6', '7'
21-
it { is_expected.to contain_file('/usr/local/sbin/cvmfs_fsck_cron.sh').with_content(%r{\s* nice ionice -c3 /usr/bin/cvmfs_fsck /var/lib/cvmfs/shared$}) }
22-
it { is_expected.to contain_cron('clean_quarantaine') }
23-
it { is_expected.to contain_cron('cvmfs_fsck') }
24-
it { is_expected.not_to contain_systemd__tmpfile('cvmfs-quarantaine.conf') }
25-
it { is_expected.not_to contain_systemd__timer('cvmfs-fsck.timer') }
26-
else
27-
it { is_expected.not_to contain_file('/usr/local/sbin/cvmfs_fsck_cron.sh') }
28-
it { is_expected.not_to contain_cron('clean_quarantaine') }
29-
it { is_expected.not_to contain_cron('cvmfs_fsck') }
30-
it { is_expected.to contain_systemd__tmpfile('cvmfs-quarantaine.conf').with_ensure('absent') }
19+
it { is_expected.not_to contain_file('/usr/local/sbin/cvmfs_fsck_cron.sh') }
20+
it { is_expected.not_to contain_cron('clean_quarantaine') }
21+
it { is_expected.not_to contain_cron('cvmfs_fsck') }
22+
it { is_expected.to contain_systemd__tmpfile('cvmfs-quarantaine.conf').with_ensure('absent') }
3123

32-
it {
33-
is_expected.to contain_systemd__timer('cvmfs-fsck.timer').
34-
with_service_content(%r{^ExecStart=/usr/bin/cvmfs_fsck /var/lib/cvmfs/shared$}).
35-
with_service_content(%r{^ConditionPathExists=/var/lib/cvmfs/shared/txn$}).
36-
with_service_content(%r{^User=cvmfs$}).
37-
with_timer_content(%r{^OnUnitActiveSec=1week$}).
38-
without_timer_content(%r{^OnBootSec$})
39-
}
40-
end
24+
it {
25+
is_expected.to contain_systemd__timer('cvmfs-fsck.timer').
26+
with_service_content(%r{^ExecStart=/usr/bin/cvmfs_fsck /var/lib/cvmfs/shared$}).
27+
with_service_content(%r{^ConditionPathExists=/var/lib/cvmfs/shared/txn$}).
28+
with_service_content(%r{^User=cvmfs$}).
29+
with_timer_content(%r{^OnUnitActiveSec=1week$}).
30+
without_timer_content(%r{^OnBootSec$})
31+
}
4132
end
4233

4334
context 'with onreboot true' do
@@ -47,13 +38,8 @@
4738
}
4839
end
4940

50-
case facts[:os]['release']['major']
51-
when '6', '7'
52-
it { is_expected.to contain_cron('cvmfs_fsck_on_reboot') }
53-
else
54-
it { is_expected.not_to contain_cron('cvmfs_fsck_on_reboot') }
55-
it { is_expected.to contain_systemd__timer('cvmfs-fsck.timer').with_timer_content(%r{^OnBootSec=5min$}) }
56-
end
41+
it { is_expected.not_to contain_cron('cvmfs_fsck_on_reboot') }
42+
it { is_expected.to contain_systemd__timer('cvmfs-fsck.timer').with_timer_content(%r{^OnBootSec=5min$}) }
5743
end
5844

5945
context 'with onreboot false' do
@@ -63,12 +49,7 @@
6349
}
6450
end
6551

66-
case facts[:os]['release']['major']
67-
when '6', '7'
68-
it { is_expected.not_to contain_cron('cvmfs_fsck_on_reboot') }
69-
else
70-
it { is_expected.to contain_systemd__timer('cvmfs-fsck.timer').with_timer_content(%r{^OnUnitActiveSec=1week$}) }
71-
end
52+
it { is_expected.to contain_systemd__timer('cvmfs-fsck.timer').with_timer_content(%r{^OnUnitActiveSec=1week$}) }
7253
end
7354

7455
context 'with options set' do
@@ -79,13 +60,8 @@
7960
}
8061
end
8162

82-
case facts[:os]['release']['major']
83-
when '6', '7'
84-
it { is_expected.to contain_file('/usr/local/sbin/cvmfs_fsck_cron.sh').with_content(%r{\s* nice ionice -c3 /usr/bin/cvmfs_fsck -p /foo/shared$}) }
85-
else
86-
it { is_expected.to contain_systemd__timer('cvmfs-fsck.timer').with_service_content(%r{^ExecStart=/usr/bin/cvmfs_fsck -p /foo/shared$}) }
87-
it { is_expected.to contain_systemd__timer('cvmfs-fsck.timer').with_service_content(%r{^ConditionPathExists=/foo/shared/txn$}) }
88-
end
63+
it { is_expected.to contain_systemd__timer('cvmfs-fsck.timer').with_service_content(%r{^ExecStart=/usr/bin/cvmfs_fsck -p /foo/shared$}) }
64+
it { is_expected.to contain_systemd__timer('cvmfs-fsck.timer').with_service_content(%r{^ConditionPathExists=/foo/shared/txn$}) }
8965
end
9066
end
9167
end

spec/classes/init_spec.rb

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,6 @@
7777
case facts[:os]['family']
7878
when 'RedHat'
7979
case facts[:os]['release']['major']
80-
when '7'
81-
it { is_expected.to contain_yumrepo('cvmfs').with_baseurl('https://cvmrepo.s3.cern.ch/cvmrepo/yum/cvmfs/EL/7/x86_64') }
82-
it { is_expected.to contain_yumrepo('cvmfs-testing').with_baseurl('https://cvmrepo.s3.cern.ch/cvmrepo/yum/cvmfs-testing/EL/7/x86_64') }
83-
it { is_expected.to contain_yumrepo('cvmfs-config').with_baseurl('https://cvmrepo.s3.cern.ch/cvmrepo/yum/cvmfs-config/EL/7/x86_64') }
8480
when '8'
8581
it { is_expected.to contain_yumrepo('cvmfs').with_baseurl('https://cvmrepo.s3.cern.ch/cvmrepo/yum/cvmfs/EL/8/x86_64') }
8682
it { is_expected.to contain_yumrepo('cvmfs-testing').with_baseurl('https://cvmrepo.s3.cern.ch/cvmrepo/yum/cvmfs-testing/EL/8/x86_64') }
@@ -146,14 +142,8 @@
146142
it { is_expected.to compile.with_all_deps }
147143
it { is_expected.to contain_service('autofs') }
148144

149-
case [facts[:os]['family'], facts[:os]['release']['major']]
150-
when %w[RedHat 7], ['Debian', '18.04']
151-
it { is_expected.to contain_augeas('cvmfs_automaster') }
152-
it { is_expected.not_to contain_file('/etc/auto.master.d/cvmfs.autofs') }
153-
else
154-
it { is_expected.to contain_file('/etc/auto.master.d/cvmfs.autofs') }
155-
it { is_expected.not_to contain_augeas('cvmfs_automaster') }
156-
end
145+
it { is_expected.to contain_file('/etc/auto.master.d/cvmfs.autofs') }
146+
it { is_expected.not_to contain_augeas('cvmfs_automaster') }
157147
end
158148

159149
context 'with mount method setto mount' do

templates/cvmfs_fsck_cron.sh.erb

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)