Skip to content

Commit

Permalink
Merge pull request #496 from bastelfreak/debian8
Browse files Browse the repository at this point in the history
Drop Debian 8 support/compatibility
  • Loading branch information
bastelfreak authored Sep 26, 2020
2 parents 8b9189c + 529ed33 commit 860c057
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 398 deletions.
1 change: 0 additions & 1 deletion .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
docker_sets:
- set: centos7-64
- set: centos8-64
- set: debian8-64
- set: debian9-64
- set: debian10-64
- set: ubuntu1604-64
Expand Down
8 changes: 0 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,6 @@ jobs:
bundler_args: --without development release
env: BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_setfile=centos8-64 CHECK=beaker
services: docker
- rvm: 2.5.3
bundler_args: --without development release
env: BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_setfile=debian8-64 CHECK=beaker
services: docker
- rvm: 2.5.3
bundler_args: --without development release
env: BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_setfile=debian8-64 CHECK=beaker
services: docker
- rvm: 2.5.3
bundler_args: --without development release
env: BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_setfile=debian9-64 CHECK=beaker
Expand Down
8 changes: 4 additions & 4 deletions manifests/alertmanager.pp
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@
}

$alertmanager_reload = $prometheus::init_style ? {
'systemd' => "systemctl reload-or-restart ${service_name}",
/^(upstart|none)$/ => "service ${service_name} reload",
/^(sysv|redhat|sles|debian)$/ => "/etc/init.d/${service_name} reload",
'launchd' => "launchctl stop ${service_name} && launchctl start ${service_name}",
'systemd' => "systemctl reload-or-restart ${service_name}",
/^(upstart|none)$/ => "service ${service_name} reload",
/^(sysv|redhat|sles)$/ => "/etc/init.d/${service_name} reload",
'launchd' => "launchctl stop ${service_name} && launchctl start ${service_name}",
}

exec { 'alertmanager-reload':
Expand Down
2 changes: 1 addition & 1 deletion manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
Class['systemd::systemctl::daemon_reload'] -> Class['prometheus::run_service']
}
}
'sysv', 'redhat', 'debian', 'sles': {
'sysv', 'redhat', 'sles': {
$content = $prometheus::server::init_style ? {
'redhat' => template('prometheus/prometheus.sysv.erb'), # redhat and sysv share the same template file
default => template("prometheus/prometheus.${prometheus::server::init_style}.erb"),
Expand Down
9 changes: 0 additions & 9 deletions manifests/daemon.pp
Original file line number Diff line number Diff line change
Expand Up @@ -194,15 +194,6 @@
notify => $notify_service,
}
}
'debian': {
file { "/etc/init.d/${name}":
mode => '0555',
owner => 'root',
group => 'root',
content => template('prometheus/daemon.debian.erb'),
notify => $notify_service,
}
}
'sles': {
file { "/etc/init.d/${name}":
mode => '0555',
Expand Down
8 changes: 4 additions & 4 deletions manifests/service_reload.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
$init_selector = $prometheus::run_service::init_selector

$prometheus_reload = $prometheus::server::init_style ? {
'systemd' => "systemctl reload-or-restart ${init_selector}",
/^(upstart|none)$/ => "service ${init_selector} reload",
/^(sysv|redhat|sles|debian)$/ => "/etc/init.d/${init_selector} reload",
'launchd' => "launchctl stop ${init_selector} && launchctl start ${init_selector}",
'systemd' => "systemctl reload-or-restart ${init_selector}",
/^(upstart|none)$/ => "service ${init_selector} reload",
/^(sysv|redhat|sles)$/ => "/etc/init.d/${init_selector} reload",
'launchd' => "launchctl stop ${init_selector} && launchctl start ${init_selector}",
}

exec { 'prometheus-reload':
Expand Down
1 change: 0 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
{
"operatingsystem": "Debian",
"operatingsystemrelease": [
"8",
"9",
"10"
]
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/prometheus_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
'content' => File.read(fixtures('files', "prometheus#{prom_major}.sysv"))
)
}
elsif ['centos-7-x86_64', 'centos-8-x86_64', 'debian-8-x86_64', 'debian-9-x86_64', 'debian-10-x86_64', 'redhat-7-x86_64', 'redhat-8-x86_64', 'ubuntu-16.04-x86_64', 'ubuntu-18.04-x86_64', 'virtuozzolinux-7-x86_64'].include?(os)
elsif ['centos-7-x86_64', 'centos-8-x86_64', 'debian-9-x86_64', 'debian-10-x86_64', 'redhat-7-x86_64', 'redhat-8-x86_64', 'ubuntu-16.04-x86_64', 'ubuntu-18.04-x86_64', 'virtuozzolinux-7-x86_64'].include?(os)
# 'archlinux-5-x86_64' got removed from that list. It has systemd, but we use the repo packages and their shipped unit files.
# init_style = 'systemd'

Expand Down
2 changes: 1 addition & 1 deletion spec/classes/server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
parameters
end

if ['centos-7-x86_64', 'centos-8-x86_64', 'debian-8-x86_64', 'debian-9-x86_64', 'redhat-7-x86_64', 'redhat-8-x86_64', 'ubuntu-16.04-x86_64', 'ubuntu-18.04-x86_64'].include?(os)
if ['centos-7-x86_64', 'centos-8-x86_64', 'debian-9-x86_64', 'redhat-7-x86_64', 'redhat-8-x86_64', 'ubuntu-16.04-x86_64', 'ubuntu-18.04-x86_64'].include?(os)
prom_version = parameters[:version] || '1.5.2'
prom_major = prom_version[0]
it {
Expand Down
32 changes: 3 additions & 29 deletions spec/defines/daemon_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,33 +92,7 @@
end

# prometheus::config
if ['debian-7-x86_64'].include?(os)
# init_style = 'debian'

it {
is_expected.to contain_file('/etc/init.d/smurf_exporter').with(
'mode' => '0555',
'owner' => 'root',
'group' => 'root'
).with_content(
%r{DAEMON_ARGS=''\n}
).with_content(
%r{USER=smurf_user\n}
)
}

context 'with overidden bin_name' do
let(:params) do
parameters.merge(bin_name: 'notsmurf_exporter')
end

it {
is_expected.to contain_file('/etc/init.d/smurf_exporter').with_content(
%r{DAEMON=/usr/local/bin/notsmurf_exporter}
)
}
end
elsif ['centos-6-x86_64', 'redhat-6-x86_64'].include?(os)
if ['centos-6-x86_64', 'redhat-6-x86_64'].include?(os)
# init_style = 'sysv'

it {
Expand All @@ -142,7 +116,7 @@
)
}
end
elsif ['centos-7-x86_64', 'centos-8-x86_64', 'debian-8-x86_64', 'debian-9-x86_64', 'debian-10-x86_64', 'redhat-7-x86_64', 'redhat-8-x86_64', 'ubuntu-16.04-x86_64', 'ubuntu-18.04-x86_64', 'archlinux-5-x86_64', 'virtuozzolinux-7-x86_64'].include?(os)
elsif ['centos-7-x86_64', 'centos-8-x86_64', 'debian-9-x86_64', 'debian-10-x86_64', 'redhat-7-x86_64', 'redhat-8-x86_64', 'ubuntu-16.04-x86_64', 'ubuntu-18.04-x86_64', 'archlinux-5-x86_64', 'virtuozzolinux-7-x86_64'].include?(os)
# init_style = 'systemd'

it { is_expected.to contain_class('systemd') }
Expand Down Expand Up @@ -215,7 +189,7 @@
}
end

if ['debian-7-x86_64', 'ubuntu-14.04-x86_64', 'debian-8-x86_64', 'ubuntu-16.04-x86_64'].include?(os)
if os == 'ubuntu-16.04-x86_64'
it {
is_expected.to contain_file('/etc/default/smurf_exporter').with(
'mode' => '0644',
Expand Down
2 changes: 0 additions & 2 deletions spec/spec_helper_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ def os_specific_facts(facts)
{ service_provider: 'systemd' }
when 'Debian'
case facts[:os]['release']['major']
when '8'
{ service_provider: 'systemd' }
when '9'
{ service_provider: 'systemd' }
when '10'
Expand Down
162 changes: 0 additions & 162 deletions templates/daemon.debian.erb

This file was deleted.

Loading

0 comments on commit 860c057

Please sign in to comment.