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

Drop EL6 support #823

Merged
merged 4 commits into from
Feb 4, 2022
Merged
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
49 changes: 21 additions & 28 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -288,37 +288,30 @@
$systemd_unit_name = 'puppet-run'
# Mechanisms to manage and reload/restart the agent
# If supported on the OS, reloading is prefered since it does not kill a currently active puppet run
case $facts['os']['family'] {
'Debian' : {
$agent_restart_command = "/usr/sbin/service ${service_name} reload"
$unavailable_runmodes = []
if $facts['service_provider'] == 'systemd' {
$agent_restart_command = "/bin/systemctl reload-or-restart ${service_name}"
$unavailable_runmodes = $facts['os']['family'] ? {
'Archlinux' => ['cron'],
default => [],
}
'Redhat' : {
# PSBM is a CentOS 6 based distribution
# it reports its $osreleasemajor as 2, not 6.
# thats why we're matching for '2' in both parts
# Amazon Linux is like RHEL6 but reports its osreleasemajor as 2017 or 2018.
$agent_restart_command = $facts['os']['release']['major'] ? {
/^(2|5|6|2017|2018)$/ => "/sbin/service ${service_name} reload",
'7' => "/usr/bin/systemctl reload-or-restart ${service_name}",
default => undef,
} else {
case $facts['os']['family'] {
'Debian': {
$agent_restart_command = "/usr/sbin/service ${service_name} reload"
$unavailable_runmodes = ['systemd.timer']
}
$unavailable_runmodes = $facts['os']['release']['major'] ? {
/^(2|5|6|2017|2018)$/ => ['systemd.timer'],
default => [],
'RedHat': {
$agent_restart_command = "/sbin/service ${service_name} reload"
$unavailable_runmodes = ['systemd.timer']
}
'Windows': {
$agent_restart_command = undef
$unavailable_runmodes = ['cron', 'systemd.timer']
}
default : {
$agent_restart_command = undef
$unavailable_runmodes = ['systemd.timer']
}
}
'Windows': {
$agent_restart_command = undef
$unavailable_runmodes = ['cron', 'systemd.timer']
}
'Archlinux': {
$agent_restart_command = "/usr/bin/systemctl reload-or-restart ${service_name}"
$unavailable_runmodes = ['cron']
}
default : {
$agent_restart_command = undef
$unavailable_runmodes = ['systemd.timer']
}
}

Expand Down
3 changes: 0 additions & 3 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,20 @@
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"6",
"7",
"8"
]
},
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"6",
"7",
"8"
]
},
{
"operatingsystem": "Scientific",
"operatingsystemrelease": [
"6",
"7"
]
},
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/hieradata/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ puppet::server_reports: 'store'
puppet::server_external_nodes: ''
# only for install test - don't think to use this in production!
# https://docs.puppet.com/puppetserver/latest/tuning_guide.html
puppet::server_jvm_max_heap_size: '256m'
puppet::server_jvm_max_heap_size: '768m'
puppet::server_jvm_min_heap_size: '256m'
14 changes: 0 additions & 14 deletions spec/acceptance/nodesets/centos-6-x64.yml

This file was deleted.

14 changes: 0 additions & 14 deletions spec/acceptance/nodesets/centos-7-x64.yml

This file was deleted.

12 changes: 6 additions & 6 deletions spec/classes/puppet_agent_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@

it { is_expected.to contain_class('puppet::agent::service::systemd').with_enabled(false) }
case os
when /\Adebian-/, /\A(redhat|centos|scientific)-(7|8)/, /\Afedora-/, /\Aubuntu-/, /\Aarchlinux-/
when /\Adebian-/, /\A(redhat|centos|scientific)-(7|8)/, /\Afedora-/, /\Aubuntu-/, /\Asles-12-/, /\Aarchlinux-/
it do
is_expected.to contain_service('puppet-run.timer')
.with_ensure(false)
Expand Down Expand Up @@ -171,7 +171,7 @@
case os
when /\A(windows|archlinux)/
it { is_expected.to raise_error(Puppet::Error, /Runmode of cron not supported on #{facts[:kernel]} operating systems!/) }
when /\Adebian-/, /\A(redhat|centos|scientific)-(7|8)/, /\Afedora-/, /\Aubuntu-/
when /\Adebian-/, /\A(redhat|centos|scientific)-(7|8)/, /\Afedora-/, /\Aubuntu-/, /\Asles-12/
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_concat__fragment('puppet.conf_agent') }
it { is_expected.to contain_class('puppet::agent::service::cron').with_enabled(true) }
Expand Down Expand Up @@ -219,7 +219,7 @@
case os
when /\A(windows|archlinux)/
it { is_expected.to raise_error(Puppet::Error, /Runmode of cron not supported on #{facts[:kernel]} operating systems!/) }
when /\Adebian-/, /\A(redhat|centos|scientific)-(7|8)/, /\Afedora-/, /\Aubuntu-/
when /\Adebian-/, /\A(redhat|centos|scientific)-(7|8)/, /\Afedora-/, /\Aubuntu-/, /\Asles-12/
it { is_expected.to contain_class('puppet::agent::service::cron').with_enabled(true) }
it { is_expected.to contain_class('puppet::agent::service::daemon').with_enabled(false) }
it do
Expand Down Expand Up @@ -260,7 +260,7 @@
end

case os
when /\Adebian-/, /\A(redhat|centos|scientific)-(7|8)/, /\Afedora-/, /\Aubuntu-/, /\Aarchlinux-/
when /\Adebian-/, /\A(redhat|centos|scientific)-(7|8)/, /\Afedora-/, /\Aubuntu-/, /\Asles-12/, /\Aarchlinux-/
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_class('puppet::agent::service::daemon').with_enabled(false) }
it { is_expected.to contain_class('puppet::agent::service::cron').with_enabled(false) }
Expand Down Expand Up @@ -303,7 +303,7 @@
end

case os
when /\Adebian-/, /\A(redhat|centos|scientific)-(7|8)/, /\Afedora-/, /\Aubuntu-/, /\Aarchlinux-/
when /\Adebian-/, /\A(redhat|centos|scientific)-(7|8)/, /\Afedora-/, /\Aubuntu-/, /\Asles-12/, /\Aarchlinux-/
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_class('puppet::agent::service::daemon').with_enabled(false) }
it { is_expected.to contain_class('puppet::agent::service::cron').with_enabled(false) }
Expand Down Expand Up @@ -351,7 +351,7 @@
it { is_expected.to contain_class('puppet::agent::service::systemd').with_enabled(false) }

case os
when /\Adebian-/, /\A(redhat|centos|scientific)-(7|8)/, /\Afedora-/, /\Aubuntu-/, /\Aarchlinux-/
when /\Adebian-/, /\A(redhat|centos|scientific)-(7|8)/, /\Afedora-/, /\Aubuntu-/, /\Asles-12/, /\Aarchlinux-/
it { is_expected.to contain_service('puppet-run.timer').with_ensure(false) }
else
it { is_expected.not_to contain_service('puppet-run.timer') }
Expand Down