Skip to content

Commit

Permalink
Merge pull request #833 from voxpupuli/dropubuntu16
Browse files Browse the repository at this point in the history
Drop EoL Ubuntu 16.04
  • Loading branch information
bastelfreak authored Aug 10, 2022
2 parents 8ad5548 + 64bfcf1 commit 7f7a682
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 87 deletions.
26 changes: 2 additions & 24 deletions manifests/web.pp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
# zabbix frontend 5.x is not supported, among others, on stretch and xenial.
# https://www.zabbix.com/documentation/current/manual/installation/frontend/frontend_on_debian
if $facts['os']['name'] in ['ubuntu', 'debian'] and versioncmp($zabbix_version, '5') >= 0 {
if versioncmp($facts['os']['release']['major'], '16.04') == 0 or versioncmp($facts['os']['release']['major'], '9') == 0 {
if versioncmp($facts['os']['release']['major'], '9') == 0 {
fail("${facts['os']['family']} ${$facts['os']['release']['major']} is not supported for zabbix::web")
}
}
Expand Down Expand Up @@ -227,29 +227,7 @@
case $facts['os']['name'] {
'ubuntu', 'debian': {
$zabbix_web_package = 'zabbix-frontend-php'

# Check OS release for proper prefix
case $facts['os']['name'] {
'Ubuntu': {
if versioncmp($facts['os']['release']['major'], '16.04') >= 0 {
$php_db_package = "php-${db}"
}
else {
$php_db_package = "php5-${db}"
}
}
'Debian': {
if versioncmp($facts['os']['release']['major'], '9') >= 0 {
$php_db_package = "php-${db}"
}
else {
$php_db_package = "php5-${db}"
}
}
default: {
$php_db_package = "php5-${db}"
}
}
$php_db_package = "php-${db}"

package { $php_db_package:
ensure => $zabbix_package_state,
Expand Down
1 change: 0 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@
{
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
"16.04",
"18.04",
"20.04"
]
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/zabbix_application_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'spec_helper_acceptance'
require 'serverspec_type_zabbixapi'

describe 'zabbix_application type', unless: default[:platform] =~ %r{(ubuntu-16.04|debian-9|archlinux)} do
describe 'zabbix_application type', unless: default[:platform] =~ %r{(debian-9|archlinux)} do
supported_versions.each do |zabbix_version|
# 5.2 and 5.4 server packages are not available for RHEL 7
next if zabbix_version == '5.2' && default[:platform] == 'el-7-x86_64'
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/zabbix_host_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
require 'serverspec_type_zabbixapi'

# rubocop:disable RSpec/LetBeforeExamples
describe 'zabbix_host type', unless: default[:platform] =~ %r{(ubuntu-16.04|debian-9|archlinux)} do
describe 'zabbix_host type', unless: default[:platform] =~ %r{(debian-9|archlinux)} do
supported_versions.each do |zabbix_version|
# >= 5.2 server packages are not available for RHEL 7
next if zabbix_version >= '5.2' && default[:platform] == 'el-7-x86_64'
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/zabbix_hostgroup_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'spec_helper_acceptance'
require 'serverspec_type_zabbixapi'

describe 'zabbix_hostgroup type', unless: default[:platform] =~ %r{(ubuntu-16.04|debian-9|archlinux)} do
describe 'zabbix_hostgroup type', unless: default[:platform] =~ %r{(debian-9|archlinux)} do
supported_versions.each do |zabbix_version|
# >= 5.2 server packages are not available for RHEL 7
next if zabbix_version >= '5.2' && default[:platform] == 'el-7-x86_64'
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/zabbix_proxy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
require 'serverspec_type_zabbixapi'

# rubocop:disable RSpec/LetBeforeExamples
describe 'zabbix_proxy type', unless: default[:platform] =~ %r{(ubuntu-16.04|debian-9|archlinux)} do
describe 'zabbix_proxy type', unless: default[:platform] =~ %r{(debian-9|archlinux)} do
supported_versions.each do |zabbix_version|
# >= 5.2 server packages are not available for RHEL 7
next if zabbix_version >= '5.2' && default[:platform] == 'el-7-x86_64'
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/zabbix_template_host_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'spec_helper_acceptance'
require 'serverspec_type_zabbixapi'

describe 'zabbix_template_host type', unless: default[:platform] =~ %r{(ubuntu-16.04|debian-9|archlinux)} do
describe 'zabbix_template_host type', unless: default[:platform] =~ %r{(debian-9|archlinux)} do
supported_versions.each do |zabbix_version|
# Zabbix 6.0 removed the ability to attach templates directly to hosts.
next if zabbix_version == '6.0'
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/zabbix_template_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'spec_helper_acceptance'
require 'serverspec_type_zabbixapi'

describe 'zabbix_template type', unless: default[:platform] =~ %r{(ubuntu-16.04|debian-9|archlinux)} do
describe 'zabbix_template type', unless: default[:platform] =~ %r{(debian-9|archlinux)} do
supported_versions.each do |zabbix_version|
# >= 5.2 server packages are not available for RHEL 7
next if zabbix_version >= '5.2' && default[:platform] == 'el-7-x86_64'
Expand Down
22 changes: 0 additions & 22 deletions spec/classes/repo_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,28 +52,6 @@

it { is_expected.to contain_apt__source('zabbix').with_location('http://repo.zabbix.com/zabbix/5.0/debian/') }
end
when '16.04'
context 'on Ubuntu 14.04 and Zabbix 5.0' do
let :params do
{
zabbix_version: '5.0',
manage_repo: true
}
end

it { is_expected.to contain_apt__source('zabbix').with_location('http://repo.zabbix.com/zabbix/5.0/ubuntu/') }
end

context 'on Ubuntu 16.04 and Zabbix 4.0' do
let :params do
{
zabbix_version: '4.0',
manage_repo: true
}
end

it { is_expected.to contain_apt__source('zabbix').with_location('http://repo.zabbix.com/zabbix/4.0/ubuntu/') }
end
end
when 'RedHat'

Expand Down
35 changes: 2 additions & 33 deletions spec/classes/web_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
next if facts[:os]['name'] == 'Archlinux'
next if facts[:os]['name'] == 'Gentoo'
next if facts[:os]['name'] == 'Debian' && facts[:os]['release']['major'] == '9'
next if facts[:os]['name'] == 'Ubuntu' && facts[:os]['release']['major'] == '16.04'
# There are no zabbix 5.2 packages for Debian 11
next if facts[:os]['name'] == 'Debian' && facts[:os]['release']['major'] == '11' && zabbix_version == '5.2'

Expand Down Expand Up @@ -64,22 +63,7 @@
super().merge(zabbix_version: zabbix_version)
end

pgsqlpackage = case facts[:operatingsystem]
when 'Ubuntu'
if facts[:operatingsystemmajrelease] >= '16.04'
'php-pgsql'
else
'php5-pgsql'
end
when 'Debian'
if facts[:operatingsystemmajrelease].to_i >= 9
'php-pgsql'
else
'php5-pgsql'
end
else
'php5-pgsql'
end
pgsqlpackage = 'php-pgsql'

packages = if facts[:osfamily] == 'RedHat'
if facts[:operatingsystemmajrelease].to_i == 7 &&
Expand All @@ -104,22 +88,7 @@
super().merge(database_type: 'mysql')
end

mysqlpackage = case facts[:operatingsystem]
when 'Ubuntu'
if facts[:operatingsystemmajrelease] >= '16.04'
'php-mysql'
else
'php5-mysql'
end
when 'Debian'
if facts[:operatingsystemmajrelease].to_i >= 9
'php-mysql'
else
'php5-mysql'
end
else
'php5-mysql'
end
mysqlpackage = 'php-mysql'

packages = facts[:osfamily] == 'RedHat' ? %w[zabbix-web-mysql zabbix-web] : ['zabbix-frontend-php', mysqlpackage]
packages.each do |package|
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def baseline_os_hash
},
{
'operatingsystem' => 'Ubuntu',
'operatingsystemrelease' => %w[16.04 18.04 20.04]
'operatingsystemrelease' => %w[18.04 20.04]
},
{
'operatingsystem' => 'Archlinux',
Expand Down

0 comments on commit 7f7a682

Please sign in to comment.