Skip to content

Commit 19e67df

Browse files
author
Roberto Valentini
committed
Add zabbix 7.0 support in CI
skip zabbixapi resource check do to the gem was not compatible with zabbix 7.0 api
1 parent 051f24c commit 19e67df

File tree

11 files changed

+27
-7
lines changed

11 files changed

+27
-7
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020
name: Puppet
2121
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v2
2222
with:
23-
beaker_facter: 'zabbix_version:Zabbix:5.0,6.0'
23+
beaker_facter: 'zabbix_version:Zabbix:5.0,6.0,7.0'

manifests/repo.pp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@
3131
}
3232
case $facts['os']['family'] {
3333
'RedHat': {
34-
if versioncmp(fact('os.release.major'), '9') >= 0 {
34+
if (versioncmp(fact('os.release.major'), '7') >= 0 and $zabbix_version == '7.0') {
35+
$gpgkey_zabbix = 'https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-B5333005'
36+
$gpgkey_nonsupported = 'https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-B5333005'
37+
} elsif versioncmp(fact('os.release.major'), '9') >= 0 {
3538
$gpgkey_zabbix = 'https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD'
3639
$gpgkey_nonsupported = 'https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD'
3740
} else {
@@ -139,6 +142,10 @@
139142
id => 'A1848F5352D022B9471D83D0082AB56BA14FE591',
140143
source => 'https://repo.zabbix.com/zabbix-official-repo.key',
141144
}
145+
apt::key { 'zabbix-4C3D6F2':
146+
id => '4C3D6F2CC75F5146754FC374D913219AB5333005',
147+
source => 'https://repo.zabbix.com/zabbix-official-repo.key',
148+
}
142149

143150
# Debian 11 provides Zabbix 5.0 by default. This can cause problems for 4.0 versions
144151
$pinpriority = $facts['os']['release']['major'] ? {
@@ -153,6 +160,7 @@
153160
require => [
154161
Apt_key['zabbix-FBABD5F'],
155162
Apt_key['zabbix-A1848F5'],
163+
Apt_key['zabbix-4C3D6F2'],
156164
],
157165
}
158166

spec/acceptance/zabbix_host_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
# rubocop:disable RSpec/LetBeforeExamples
77
describe 'zabbix_host type' do
88
supported_server_versions(default[:platform]).each do |zabbix_version|
9+
next if zabbix_version >= '7.0'
10+
911
context "create zabbix_host resources with zabbix version #{zabbix_version}" do
1012
# This will deploy a running Zabbix setup (server, web, db) which we can
1113
# use for custom type tests

spec/acceptance/zabbix_hostgroup_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
describe 'zabbix_hostgroup type' do
77
supported_server_versions(default[:platform]).each do |zabbix_version|
8+
next if zabbix_version >= '7.0'
9+
810
context "create zabbix_hostgroup resources with zabbix version #{zabbix_version}" do
911
# This will deploy a running Zabbix setup (server, web, db) which we can
1012
# use for custom type tests

spec/acceptance/zabbix_proxy_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
# rubocop:disable RSpec/LetBeforeExamples
77
describe 'zabbix_proxy type' do
88
supported_server_versions(default[:platform]).each do |zabbix_version|
9+
next if zabbix_version >= '7.0'
10+
911
context "create zabbix_proxy resources with zabbix version #{zabbix_version}" do
1012
# This will deploy a running Zabbix setup (server, web, db) which we can
1113
# use for custom type tests

spec/acceptance/zabbix_template_host_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
describe 'zabbix_template_host type' do
77
supported_server_versions(default[:platform]).each do |zabbix_version|
88
# Zabbix 6.0 removed the ability to attach templates directly to hosts.
9-
next if zabbix_version == '6.0'
9+
next if zabbix_version >= '6.0'
1010

1111
context "create zabbix_template_host resources with zabbix version #{zabbix_version}" do
1212
template = case zabbix_version

spec/acceptance/zabbix_template_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
describe 'zabbix_template type' do
77
supported_server_versions(default[:platform]).each do |zabbix_version|
8+
next if zabbix_version >= '7.0'
9+
810
context "create zabbix_template resources with zabbix version #{zabbix_version}" do
911
# This will deploy a running Zabbix setup (server, web, db) which we can
1012
# use for custom type tests

spec/classes/database_mysql_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
end
3131

3232
sql_server = case zabbix_version
33-
when '6.0'
33+
when '6.0', '7.0'
3434
'server.sql'
3535
else
3636
'create.sql'

spec/classes/database_postgresql_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
end
4444

4545
sql_server = case zabbix_version
46-
when '6.0'
46+
when '6.0', '7.0'
4747
'server.sql'
4848
else
4949
'create.sql'

spec/setup_acceptance_node.pp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
target => '/bin/mkdir',
99
}
1010
}
11+
package { 'gnupg':
12+
ensure => present,
13+
}
1114
}
1215
'Ubuntu': {
1316
# The Ubuntu 18.04+ docker image has a dpkg config that won't install docs, to keep used space low

0 commit comments

Comments
 (0)