Add Debian 11 support
MODIFY
manifests/agent.pp
manifests/agent.pp
@@ -214,6 +214,12 @@ class zabbix::agent (
String $service_type = $zabbix::params::service_type,
Boolean $manage_startup_script = $zabbix::params::manage_startup_script,
) inherits zabbix::params {
+ if $facts['os']['family'] == 'Debian' and versioncmp($facts['os']['release']['major'], '11') == 0 {
+ if versioncmp($zabbix_version, '5.2') == 0 {
+ fail('Zabbix 5.2 is not supported on Debian 11!')
+ }
+ }
+
# Find if listenip is set. If not, we can set to specific ip or
# to network name. If more than 1 interfaces are available, we
# can find the ipaddress of this specific interface if listenip

MODIFY
manifests/proxy.pp
manifests/proxy.pp
@@ -301,6 +301,12 @@ class zabbix::proxy (
fail('Archlinux is currently not supported for zabbix::proxy ')
}
+ if $facts['os']['family'] == 'Debian' and versioncmp($facts['os']['release']['major'], '11') == 0 {
+ if versioncmp($zabbix_version, '5.2') == 0 {
+ fail('Zabbix 5.2 is not supported on Debian 11!')
+ }
+ }
+
# Find if listenip is set. If not, we can set to specific ip or
# to network name. If more than 1 interfaces are available, we
# can find the ipaddress of this specific interface if listenip

MODIFY
manifests/server.pp
manifests/server.pp
@@ -277,6 +277,12 @@ class zabbix::server (
}
}
+ if $facts['os']['family'] == 'Debian' and versioncmp($facts['os']['release']['major'], '11') == 0 {
+ if versioncmp($zabbix_version, '5.2') == 0 {
+ fail('Zabbix 5.2 is not supported on Debian 11!')
+ }
+ }
+
# Only include the repo class if it has not yet been included
unless defined(Class['Zabbix::Repo']) {
class { 'zabbix::repo':

MODIFY
manifests/web.pp
manifests/web.pp
@@ -156,6 +156,12 @@ class zabbix::web (
}
}
+ if $facts['os']['family'] == 'Debian' and versioncmp($facts['os']['release']['major'], '11') == 0 {
+ if versioncmp($zabbix_version, '5.2') == 0 {
+ fail('Zabbix 5.2 is not supported on Debian 11!')
+ }
+ }
+
# Only include the repo class if it has not yet been included
unless defined(Class['Zabbix::Repo']) {
class { 'zabbix::repo':

MODIFY
metadata.json
metadata.json
"operatingsystem": "Debian",
"operatingsystemrelease": [
"9",
- "10"
+ "10",
+ "11"
]
},
{

MODIFY
spec/acceptance/agent_spec.rb
spec/acceptance/agent_spec.rb
require 'spec_helper_acceptance'
supported_versions.each do |version|
+ # No Zabbix 5.2 packages on Debian 11
+ next if version == '5.2' && default[:platform] == 'debian-11-amd64'
+
describe "zabbix::agent class with zabbix_version #{version}" do
it 'works idempotently with no errors' do
pp = <<-EOS

MODIFY
spec/acceptance/zabbix_application_spec.rb
spec/acceptance/zabbix_application_spec.rb
@@ -7,6 +7,8 @@ describe 'zabbix_application type', unless: default[:platform] =~ %r{(ubuntu-16.
next if zabbix_version == '5.2' && default[:platform] == 'el-7-x86_64'
# Application API was removed in Zabbix 5.4
next if zabbix_version == '5.4'
+ # No Zabbix 5.2 packages on Debian 11
+ next if zabbix_version == '5.2' && default[:platform] == 'debian-11-amd64'
template = case zabbix_version
when '4.0'

MODIFY
spec/acceptance/zabbix_host_spec.rb
spec/acceptance/zabbix_host_spec.rb
@@ -7,6 +7,8 @@ describe 'zabbix_host type', unless: default[:platform] =~ %r{(ubuntu-16.04|debi
# 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'
next if zabbix_version == '5.4' && default[:platform] == 'el-7-x86_64'
+ # No Zabbix 5.2 packages on Debian 11
+ next if zabbix_version == '5.2' && default[:platform] == 'debian-11-amd64'
context "create zabbix_host resources with zabbix version #{zabbix_version}" do
# This will deploy a running Zabbix setup (server, web, db) which we can
# use for custom type tests

MODIFY
spec/acceptance/zabbix_hostgroup_spec.rb
spec/acceptance/zabbix_hostgroup_spec.rb
@@ -6,6 +6,8 @@ describe 'zabbix_hostgroup type', unless: default[:platform] =~ %r{(ubuntu-16.04
# 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'
next if zabbix_version == '5.4' && default[:platform] == 'el-7-x86_64'
+ # No Zabbix 5.2 packages on Debian 11
+ next if zabbix_version == '5.2' && default[:platform] == 'debian-11-amd64'
context "create zabbix_hostgroup resources with zabbix version #{zabbix_version}" do
# This will deploy a running Zabbix setup (server, web, db) which we can
# use for custom type tests

MODIFY
spec/acceptance/zabbix_proxy_spec.rb
spec/acceptance/zabbix_proxy_spec.rb
@@ -7,6 +7,8 @@ describe 'zabbix_proxy type', unless: default[:platform] =~ %r{(ubuntu-16.04|deb
# 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'
next if zabbix_version == '5.4' && default[:platform] == 'el-7-x86_64'
+ # No Zabbix 5.2 packages on Debian 11
+ next if zabbix_version == '5.2' && default[:platform] == 'debian-11-amd64'
context "create zabbix_proxy resources with zabbix version #{zabbix_version}" do
# This will deploy a running Zabbix setup (server, web, db) which we can
# use for custom type tests

MODIFY
spec/acceptance/zabbix_template_host_spec.rb
spec/acceptance/zabbix_template_host_spec.rb
@@ -6,6 +6,8 @@ describe 'zabbix_template_host type', unless: default[:platform] =~ %r{(ubuntu-1
# 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'
next if zabbix_version == '5.4' && default[:platform] == 'el-7-x86_64'
+ # No Zabbix 5.2 packages on Debian 11
+ next if zabbix_version == '5.2' && default[:platform] == 'debian-11-amd64'
context "create zabbix_template_host resources with zabbix version #{zabbix_version}" do
template = case zabbix_version
when '4.0'

MODIFY
spec/acceptance/zabbix_template_spec.rb
spec/acceptance/zabbix_template_spec.rb
@@ -6,6 +6,8 @@ describe 'zabbix_template type', unless: default[:platform] =~ %r{(ubuntu-16.04|
# 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'
next if zabbix_version == '5.4' && default[:platform] == 'el-7-x86_64'
+ # No Zabbix 5.2 packages on Debian 11
+ next if zabbix_version == '5.2' && default[:platform] == 'debian-11-amd64'
context "create zabbix_template resources with zabbix version #{zabbix_version}" do
# This will deploy a running Zabbix setup (server, web, db) which we can
# use for custom type tests

MODIFY
spec/classes/server_spec.rb
spec/classes/server_spec.rb
@@ -398,8 +398,8 @@ describe 'zabbix::server' do
end
end
- # Zabbix Server 5.2 is not supported on RedHat family
- if facts[:osfamily] != 'RedHat'
+ # Zabbix Server 5.2 is not supported on RedHat family and Debian 11
+ if facts[:osfamily] != 'RedHat' && facts[:os]['release']['major'] != '11'
describe 'with zabbix_version 5.2 and Vault parameters defined' do
let :params do
{

MODIFY
spec/classes/web_spec.rb
spec/classes/web_spec.rb
@@ -19,6 +19,8 @@ describe 'zabbix::web' do
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'
context "on #{os} " do
let :facts do

Add Debian 11 support

Signed-off-by: Christos Papageorgiou <christos.papageorgioy@gmail.com>