Skip to content

Commit

Permalink
Merge pull request #927 from Valantin/bug-923
Browse files Browse the repository at this point in the history
Add Debian 12 OS support
  • Loading branch information
evgeni authored Mar 11, 2024
2 parents db01009 + 52784c1 commit 53f5969
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 5 deletions.
3 changes: 2 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@
{
"operatingsystem": "Debian",
"operatingsystemrelease": [
"11"
"11",
"12"
]
},
{
Expand Down
3 changes: 3 additions & 0 deletions spec/acceptance/agent_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
require 'spec_helper_acceptance'

supported_versions.each do |version|
# < 6.0 agent packages are not available for Debian 12
next if version < '6.0' && default[:platform] =~ %r{debian-12}

describe "zabbix::agent class with zabbix_version #{version}" do
it 'works idempotently with no errors' do
pp = <<-EOS
Expand Down
2 changes: 2 additions & 0 deletions spec/acceptance/server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ class { 'zabbix::database': }
next if zabbix_version < '6.0' && default[:platform] == 'el-9-x86_64'
# <6.0 server packages are not available for ubuntu 22.04
next if zabbix_version < '6.0' && default[:platform] =~ %r{ubuntu-22}
# < 6.0 server packages are not available for Debian 12
next if zabbix_version < '6.0' && default[:platform] =~ %r{debian-12}

context "deploys a zabbix #{zabbix_version} server" do
# Using puppet_apply as a helper
Expand Down
2 changes: 2 additions & 0 deletions spec/acceptance/zabbix_application_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
next if zabbix_version < '6.0' && default[:platform] == 'el-9-x86_64'
# <6.0 server packages are not available for ubuntu 22.04
next if zabbix_version < '6.0' && default[:platform] =~ %r{ubuntu-22}
# < 6.0 server packages are not available for Debian 12
next if zabbix_version < '6.0' && default[:platform] =~ %r{debian-12}

template = case zabbix_version
when '5.0'
Expand Down
2 changes: 2 additions & 0 deletions spec/acceptance/zabbix_host_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
next if zabbix_version < '6.0' && default[:platform] == 'el-9-x86_64'
# <6.0 server packages are not available for ubuntu 22.04
next if zabbix_version < '6.0' && default[:platform] =~ %r{ubuntu-22}
# < 6.0 server packages are not available for Debian 12
next if zabbix_version < '6.0' && default[:platform] =~ %r{debian-12}

context "create zabbix_host resources with zabbix version #{zabbix_version}" do
# This will deploy a running Zabbix setup (server, web, db) which we can
Expand Down
2 changes: 2 additions & 0 deletions spec/acceptance/zabbix_hostgroup_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
next if zabbix_version < '6.0' && default[:platform] == 'el-9-x86_64'
# <6.0 server packages are not available for ubuntu 22.04
next if zabbix_version < '6.0' && default[:platform] =~ %r{ubuntu-22}
# < 6.0 server packages are not available for Debian 12
next if zabbix_version < '6.0' && default[:platform] =~ %r{debian-12}

context "create zabbix_hostgroup resources with zabbix version #{zabbix_version}" do
# This will deploy a running Zabbix setup (server, web, db) which we can
Expand Down
2 changes: 2 additions & 0 deletions spec/acceptance/zabbix_proxy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
next if zabbix_version < '6.0' && default[:platform] == 'el-9-x86_64'
# <6.0 server packages are not available for ubuntu 22.04
next if zabbix_version < '6.0' && default[:platform] =~ %r{ubuntu-22}
# < 6.0 server packages are not available for Debian 12
next if zabbix_version < '6.0' && default[:platform] =~ %r{debian-12}

context "create zabbix_proxy resources with zabbix version #{zabbix_version}" do
# This will deploy a running Zabbix setup (server, web, db) which we can
Expand Down
2 changes: 2 additions & 0 deletions spec/acceptance/zabbix_template_host_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
next if zabbix_version < '6.0' && default[:platform] == 'el-9-x86_64'
# <6.0 server packages are not available for ubuntu 22.04
next if zabbix_version < '6.0' && default[:platform] =~ %r{ubuntu-22}
# < 6.0 server packages are not available for Debian 12
next if zabbix_version < '6.0' && default[:platform] =~ %r{debian-12}

context "create zabbix_template_host resources with zabbix version #{zabbix_version}" do
template = case zabbix_version
Expand Down
2 changes: 2 additions & 0 deletions spec/acceptance/zabbix_template_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
next if zabbix_version < '6.0' && default[:platform] == 'el-9-x86_64'
# <6.0 server packages are not available for ubuntu 22.04
next if zabbix_version < '6.0' && default[:platform] =~ %r{ubuntu-22}
# < 6.0 server packages are not available for Debian 12
next if zabbix_version < '6.0' && default[:platform] =~ %r{debian-12}

context "create zabbix_template resources with zabbix version #{zabbix_version}" do
# This will deploy a running Zabbix setup (server, web, db) which we can
Expand Down
8 changes: 5 additions & 3 deletions spec/setup_acceptance_node.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
'Debian': {
# On Debian it seems that make is searching for mkdir in /usr/bin/ but mkdir
# does not exist. Symlink it from /bin/mkdir to make it work.
file { '/usr/bin/mkdir':
ensure => link,
target => '/bin/mkdir',
if $facts['os']['release']['major'] < '12' {
file { '/usr/bin/mkdir':
ensure => link,
target => '/bin/mkdir',
}
}
}
'Ubuntu': {
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 @@ -9,7 +9,7 @@ def baseline_os_hash
},
{
'operatingsystem' => 'Debian',
'operatingsystemrelease' => %w[11]
'operatingsystemrelease' => %w[11 12]
},
{
'operatingsystem' => 'Ubuntu',
Expand Down

0 comments on commit 53f5969

Please sign in to comment.