|
16 | 16 |
|
17 | 17 | on_supported_os(baseline_os_hash).each do |os, facts| |
18 | 18 | context "on #{os}" do |
19 | | - config_path = case facts[:operatingsystem] |
| 19 | + config_path = case facts[:os]['name'] |
20 | 20 | when 'Fedora' |
21 | 21 | '/etc/zabbix_agentd.conf' |
22 | 22 | when 'windows' |
|
25 | 25 | '/etc/zabbix/zabbix_agentd.conf' |
26 | 26 | end |
27 | 27 |
|
28 | | - log_path = case facts[:operatingsystem] |
| 28 | + log_path = case facts[:os]['name'] |
29 | 29 | when 'windows' |
30 | 30 | 'C:/ProgramData/zabbix/zabbix_agentd.log' |
31 | 31 | else |
32 | 32 | '/var/log/zabbix/zabbix_agentd.log' |
33 | 33 | end |
34 | | - include_dir = case facts[:operatingsystem] |
| 34 | + include_dir = case facts[:os]['name'] |
35 | 35 | when 'windows' |
36 | 36 | 'C:/ProgramData/zabbix/zabbix_agentd.d' |
37 | 37 | else |
|
45 | 45 | '6.0' |
46 | 46 | end |
47 | 47 |
|
48 | | - case facts[:osfamily] |
| 48 | + case facts[:os]['family'] |
49 | 49 | when 'Gentoo' |
50 | 50 | package_name = 'zabbix' |
51 | 51 | service_name = 'zabbix-agentd' |
|
56 | 56 | package_name = 'zabbix-agent' |
57 | 57 | service_name = 'zabbix-agent' |
58 | 58 | end |
59 | | - # package = facts[:osfamily] == 'Gentoo' ? 'zabbix' : 'zabbix-agent' |
60 | | - # service = facts[:osfamily] == 'Gentoo' ? 'zabbix-agentd' : 'zabbix-agent' |
| 59 | + # package = facts[:os]['family'] == 'Gentoo' ? 'zabbix' : 'zabbix-agent' |
| 60 | + # service = facts[:os]['family'] == 'Gentoo' ? 'zabbix-agentd' : 'zabbix-agent' |
61 | 61 |
|
62 | 62 | context 'with all defaults' do |
63 | 63 | # Make sure package will be installed, service running and ensure of directory. |
64 | | - if facts[:kernel] == 'windows' |
| 64 | + if facts[:os]['name'] == 'windows' |
65 | 65 | it do |
66 | 66 | is_expected.to contain_package(package_name).with( |
67 | 67 | ensure: '4.4.5', |
|
81 | 81 | is_expected.to contain_service(service_name). |
82 | 82 | with_ensure('running'). |
83 | 83 | with_enable(true). |
84 | | - with_service_provider(facts[:osfamily] == 'AIX' ? 'init' : nil). |
| 84 | + with_service_provider(facts[:os]['family'] == 'AIX' ? 'init' : nil). |
85 | 85 | that_requires(["Package[#{package_name}]", "Zabbix::Startup[#{service_name}]"]) |
86 | 86 | end |
87 | 87 |
|
|
99 | 99 | } |
100 | 100 | end |
101 | 101 |
|
102 | | - case facts[:osfamily] |
| 102 | + case facts[:os]['family'] |
103 | 103 | when 'Archlinux' |
104 | 104 | it { is_expected.not_to compile.with_all_deps } |
105 | 105 | when 'Debian' |
|
216 | 216 |
|
217 | 217 | context 'it creates a startup script' do |
218 | 218 | if facts[:kernel] == 'Linux' |
219 | | - case facts[:osfamily] |
| 219 | + case facts[:os]['family'] |
220 | 220 | when 'Archlinux', 'Debian', 'Gentoo', 'RedHat' |
221 | 221 | it { is_expected.to contain_file("/etc/init.d/#{service_name}").with_ensure('absent') } |
222 | 222 | it { is_expected.to contain_file("/etc/systemd/system/#{service_name}.service").with_ensure('file') } |
|
413 | 413 | end |
414 | 414 |
|
415 | 415 | context 'when declaring manage_choco is false with zabbix_package_source specified' do |
416 | | - if facts[:kernel] == 'windows' |
| 416 | + if facts[:os]['name'] == 'windows' |
417 | 417 | let :params do |
418 | 418 | { |
419 | 419 | manage_choco: false, |
|
0 commit comments