Skip to content

Commit 8f411bf

Browse files
authored
Merge pull request #674 from bastelfreak/debian10
Add Debian 10 support
2 parents bd6c597 + 7ddc0dc commit 8f411bf

18 files changed

+115
-61
lines changed

.sync.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- set: 'ubuntu1604-64{image=ubuntu:xenial-20191212}'
55
- set: 'centos7-64{image=centos:7.6.1810}'
66
- set: debian9-64
7+
- set: debian10-64
78
secure: "ijm7hKPYWr1eg7151g5oK6MzZL4ojrgWjKlxgoBHXAdXdY88opMgvixfSJK5IMUbtanPfWRkqqABx+MYO78nfQBWDlghUzZ8sQXFeO2Ie0PgWl4nFV0kKWz+ejVaZC4dKSZlWha5pO1ek+sx7KnjIBZY82OXs/GXbjwhHx6d56YugXLuCyvfFxC7mXC9wF58bPwcYRCBSZt9CRl0OMBAFybxjdwsFMloRRhdz7f3hhlqF8Nrs1sxG1HhgiMcnrZqovNfb3Tw9K1RPYATazXxQrjcI7YHvJx0AvtHFUsn+/A0GtpKUuuPbaVdkYgE1Tye0AsAcey6RW4xhJywZglKrzDk7vfyUiU5CObeLh4/dhub3k111rDPL8v6v9t40fteduJoFLziHotQwdl37UALL7PwWZY5HuJvaBqHY2LsGs/ptGMB9ZCzxA85jfDw8lrZQ7P97SAoC34Ihs8D6vkKT9HUKHIXh19O5AAa70jReru0ej179IBjvs8m9nDwDNdY3sIsdhUU8WQ3BftDF6M8OzvgyLKDvjSs1Izag+Asl2Ze7RAQfQ2RvbfkDm9KEFnDQtXtzF4Cu1Ed6io2j1zI71JFQpIf6zb1qeNrhqulbJ15owGkQmHBgD8K+bDd1CCU4kA26axypV00XDsjfwdtFHgtUO3AlUVUim0QTMk9ATc="
89
Gemfile:
910
optional:

.travis.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ matrix:
4646
bundler_args: --without development release
4747
env: PUPPET_INSTALL_TYPE=agent BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=debian9-64 BEAKER_HYPERVISOR=docker CHECK=beaker
4848
services: docker
49+
- rvm: 2.5.3
50+
bundler_args: --without development release
51+
env: PUPPET_INSTALL_TYPE=agent BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=debian10-64 BEAKER_HYPERVISOR=docker CHECK=beaker
52+
services: docker
53+
- rvm: 2.5.3
54+
bundler_args: --without development release
55+
env: PUPPET_INSTALL_TYPE=agent BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=debian10-64 BEAKER_HYPERVISOR=docker CHECK=beaker
56+
services: docker
4957
branches:
5058
only:
5159
- master

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ group :test do
1717
gem 'fakefs', '0.13.3', :require => false if RUBY_VERSION < '2.3.0'
1818
gem 'fakefs', :require => false if RUBY_VERSION >= '2.3.0'
1919
gem 'zabbixapi', :require => false
20+
gem 'rspec-puppet-facts', :require => false, :git => 'https://github.com/ekohl/rspec-puppet-facts', :ref => '7674437d8d48af3a910ac3858c9eb63853dc1821'
2021
end
2122

2223
group :development do

manifests/params.pp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,12 @@
124124
}
125125
}
126126

127-
# Zabbix overall params. Is used by all components.
128-
$zabbix_version = downcase($facts['kernel']) ? {
129-
'windows' => '4.4.5',
130-
default => '3.4',
127+
if downcase($facts['kernel']) == 'windows' {
128+
$zabbix_version = '4.4.5'
129+
} elsif $facts['os']['name'] == 'Debian' and Integer($facts['os']['release']['major']) == 10 {
130+
$zabbix_version = '4.0'
131+
} else {
132+
$zabbix_version = '3.4'
131133
}
132134

133135
$manage_startup_script = downcase($facts['kernel']) ? {

metadata.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@
113113
{
114114
"operatingsystem": "Debian",
115115
"operatingsystemrelease": [
116-
"9"
116+
"9",
117+
"10"
117118
]
118119
},
119120
{

spec/acceptance/agent_spec.rb

Lines changed: 49 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
require 'spec_helper_acceptance'
22

33
def agent_supported(version)
4-
if default[:platform] =~ %r{(ubuntu-16.04|debian-9)-amd64}
5-
return version != '2.4'
6-
end
4+
return version != '2.4' if default[:platform] =~ %r{(ubuntu-16.04|debian-9)-amd64}
5+
return version >= '4.0' if default[:platform] =~ %r{debian-10-amd64}
76
true
87
end
98

@@ -14,7 +13,7 @@ def agent_supported(version)
1413
class { 'zabbix::agent':
1514
server => '192.168.20.11',
1615
zabbix_package_state => 'latest',
17-
zabbix_version => '#{version}'
16+
zabbix_version => '#{version}',
1817
}
1918
EOS
2019

@@ -36,42 +35,54 @@ class { 'zabbix::agent':
3635
describe file('/etc/zabbix/zabbix_agentd.conf') do
3736
its(:content) { is_expected.not_to match %r{ListenIP=} }
3837
end
39-
end
40-
end
4138

42-
describe 'zabbix::agent class with zabbix_version 3.4' do
43-
context 'With ListenIP set to an IP-Address' do
44-
it 'works idempotently with no errors' do
45-
pp = <<-EOS
46-
class { 'zabbix::agent':
47-
server => '192.168.20.11',
48-
zabbix_package_state => 'latest',
49-
listenip => '127.0.0.1',
50-
zabbix_version => '3.4'
51-
}
52-
EOS
53-
apply_manifest(pp, catch_failures: true)
54-
apply_manifest(pp, catch_changes: true)
55-
end
56-
describe file('/etc/zabbix/zabbix_agentd.conf') do
57-
its(:content) { is_expected.to match %r{ListenIP=127.0.0.1} }
39+
context 'With ListenIP set to an IP-Address' do
40+
it 'works idempotently with no errors' do
41+
pp = <<-EOS
42+
class { 'zabbix::agent':
43+
server => '192.168.20.11',
44+
zabbix_package_state => 'latest',
45+
listenip => '127.0.0.1',
46+
zabbix_version => '#{version}',
47+
}
48+
EOS
49+
apply_manifest(pp, catch_failures: true)
50+
apply_manifest(pp, catch_changes: true)
51+
end
52+
describe file('/etc/zabbix/zabbix_agentd.conf') do
53+
its(:content) { is_expected.to match %r{ListenIP=127.0.0.1} }
54+
end
5855
end
59-
end
60-
context 'With ListenIP set to lo' do
61-
it 'works idempotently with no errors' do
62-
pp = <<-EOS
63-
class { 'zabbix::agent':
64-
server => '192.168.20.11',
65-
zabbix_package_state => 'latest',
66-
listenip => 'lo',
67-
zabbix_version => '3.4'
68-
}
69-
EOS
70-
apply_manifest(pp, catch_failures: true)
71-
apply_manifest(pp, catch_changes: true)
72-
end
73-
describe file('/etc/zabbix/zabbix_agentd.conf') do
74-
its(:content) { is_expected.to match %r{ListenIP=127.0.0.1} }
56+
context 'With ListenIP set to lo' do
57+
it 'works idempotently with no errors' do
58+
pp = <<-EOS
59+
class { 'zabbix::agent':
60+
server => '192.168.20.11',
61+
zabbix_package_state => 'latest',
62+
listenip => 'lo',
63+
zabbix_version => '#{version}',
64+
}
65+
EOS
66+
apply_manifest(pp, catch_failures: true)
67+
apply_manifest(pp, catch_changes: true)
68+
end
69+
context 'With ListenIP set to an IP-Address' do
70+
it 'works idempotently with no errors' do
71+
pp = <<-EOS
72+
class { 'zabbix::agent':
73+
server => '192.168.20.11',
74+
zabbix_package_state => 'latest',
75+
listenip => '127.0.0.1',
76+
zabbix_version => '#{version}',
77+
}
78+
EOS
79+
apply_manifest(pp, catch_failures: true)
80+
apply_manifest(pp, catch_changes: true)
81+
end
82+
describe file('/etc/zabbix/zabbix_agentd.conf') do
83+
its(:content) { is_expected.to match %r{ListenIP=127.0.0.1} }
84+
end
85+
end
7586
end
7687
end
7788
end

spec/acceptance/server_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class { 'zabbix::database': } ->
2020
class { 'zabbix::server': }
2121
EOS
2222

23-
shell('yum clean metadata') if fact('os.family') == 'RedHat'
23+
cleanup_zabbix
2424

2525
# Run it twice and test for idempotency
2626
apply_manifest(pp, catch_failures: true)

spec/acceptance/zabbix_application_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require 'spec_helper_acceptance'
22
require 'serverspec_type_zabbixapi'
33

4-
describe 'zabbix_application type' do
4+
describe 'zabbix_application type', unless: default[:platform] =~ %r{debian-10-amd64} do
55
context 'create zabbix_application resources' do
66
# This will deploy a running Zabbix setup (server, web, db) which we can
77
# use for custom type tests

spec/acceptance/zabbix_host_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require 'spec_helper_acceptance'
22
require 'serverspec_type_zabbixapi'
33

4-
describe 'zabbix_host type' do
4+
describe 'zabbix_host type', unless: default[:platform] =~ %r{debian-10-amd64} do
55
context 'create zabbix_host resources' do
66
# This will deploy a running Zabbix setup (server, web, db) which we can
77
# use for custom type tests

spec/acceptance/zabbix_hostgroup_spec.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require 'spec_helper_acceptance'
22
require 'serverspec_type_zabbixapi'
33

4-
describe 'zabbix_hostgroup type' do
4+
describe 'zabbix_hostgroup type', unless: default[:platform] =~ %r{debian-10-amd64} do
55
context 'create zabbix_hostgroup resources' do
66
it 'runs successfully' do
77
# This will deploy a running Zabbix setup (server, web, db) which we can
@@ -33,8 +33,6 @@ class { 'zabbix':
3333
}
3434
EOS
3535

36-
shell('yum clean metadata') if fact('os.family') == 'RedHat'
37-
3836
# Cleanup old database
3937
cleanup_zabbix
4038

0 commit comments

Comments
 (0)