|
14 | 14 | }
|
15 | 15 | end
|
16 | 16 |
|
17 |
| - on_supported_os(baseline_os_hash).each do |os, facts| |
| 17 | + on_supported_os.each do |os, facts| |
18 | 18 | context "on #{os}" do
|
19 | 19 | config_path = case facts[:os]['name']
|
20 | 20 | when 'windows'
|
21 | 21 | 'C:/ProgramData/zabbix/zabbix_agentd.conf'
|
| 22 | + when 'FreeBSD' |
| 23 | + '/usr/local/etc/zabbix6/zabbix_agentd.conf' |
22 | 24 | else
|
23 | 25 | '/etc/zabbix/zabbix_agentd.conf'
|
24 | 26 | end
|
|
32 | 34 | include_dir = case facts[:os]['name']
|
33 | 35 | when 'windows'
|
34 | 36 | 'C:/ProgramData/zabbix/zabbix_agentd.d'
|
| 37 | + when 'FreeBSD' |
| 38 | + '/usr/local/etc/zabbix6/zabbix_agentd.d' |
35 | 39 | else
|
36 | 40 | '/etc/zabbix/zabbix_agentd.d'
|
37 | 41 | end
|
|
50 | 54 | when 'windows'
|
51 | 55 | package_name = 'zabbix-agent'
|
52 | 56 | service_name = 'Zabbix Agent'
|
| 57 | + when 'FreeBSD' |
| 58 | + package_name = 'zabbix6-agent' |
| 59 | + service_name = 'zabbix_agentd' |
53 | 60 | else
|
54 | 61 | package_name = 'zabbix-agent'
|
55 | 62 | service_name = 'zabbix-agent'
|
|
60 | 67 | context 'with all defaults' do
|
61 | 68 | it { is_expected.to contain_selinux__module('zabbix-agent') } if facts[:os]['family'] == 'RedHat'
|
62 | 69 | it { is_expected.to contain_yumrepo('zabbix-frontend') } if facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'] == '7'
|
63 |
| - it { is_expected.to contain_package('zabbix-required-scl-repo') } if facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'] == '7' |
| 70 | + it { is_expected.to contain_package('zabbix-required-scl-repo') } if facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'] == '7' && %w[OracleLinux CentOS].include?(facts[:os]['name']) |
64 | 71 | it { is_expected.to contain_apt__key('zabbix-A1848F5') } if facts[:os]['family'] == 'Debian'
|
65 | 72 | it { is_expected.to contain_apt__key('zabbix-FBABD5F') } if facts[:os]['family'] == 'Debian'
|
66 | 73 | it { is_expected.to contain_file(include_dir).with_ensure('directory') }
|
|
75 | 82 | )
|
76 | 83 | end
|
77 | 84 | else
|
78 |
| - it do |
79 |
| - is_expected.to contain_package(package_name). |
80 |
| - with_ensure('present'). |
81 |
| - with_tag('zabbix'). |
82 |
| - that_requires('Class[zabbix::repo]') |
| 85 | + |
| 86 | + if facts[:os]['family'] == 'Gentoo' |
| 87 | + it do |
| 88 | + is_expected.to contain_package(package_name). |
| 89 | + with_ensure('present'). |
| 90 | + with_tag('zabbix') |
| 91 | + end |
| 92 | + else |
| 93 | + it do |
| 94 | + is_expected.to contain_package(package_name). |
| 95 | + with_ensure('present'). |
| 96 | + with_tag('zabbix'). |
| 97 | + that_requires('Class[zabbix::repo]') |
| 98 | + end |
83 | 99 | end
|
84 | 100 |
|
85 | 101 | it do
|
|
103 | 119 | end
|
104 | 120 |
|
105 | 121 | case facts[:os]['family']
|
106 |
| - when 'Archlinux' |
| 122 | + when %w[Archlinux Gentoo FreeBSD].include?(facts[:os]['family']) |
107 | 123 | it { is_expected.not_to compile.with_all_deps }
|
108 | 124 | when 'Debian'
|
109 | 125 | # rubocop:disable RSpec/RepeatedExample
|
|
218 | 234 | end
|
219 | 235 |
|
220 | 236 | context 'when declaring manage_startup_script is true' do
|
| 237 | + next if facts[:os]['family'] == 'FreeBSD' |
| 238 | + next if facts[:os]['family'] == 'Gentoo' |
| 239 | + |
221 | 240 | let :params do
|
222 | 241 | {
|
223 | 242 | manage_startup_script: true
|
|
478 | 497 | end
|
479 | 498 |
|
480 | 499 | context 'when zabbix_package_agent is zabbix-agent2' do
|
| 500 | + next if facts[:os]['family'] == 'Gentoo' |
| 501 | + |
481 | 502 | let :params do
|
482 | 503 | {
|
483 | 504 | zabbix_package_agent: 'zabbix-agent2', startagents: 1,
|
|
0 commit comments