File tree Expand file tree Collapse file tree 5 files changed +24
-8
lines changed Expand file tree Collapse file tree 5 files changed +24
-8
lines changed Original file line number Diff line number Diff line change 127127
128128 if downcase($facts [' kernel' ]) == ' windows' {
129129 $zabbix_version = ' 4.4.5'
130- } else {
130+ } elsif $facts [ ' os ' ][ ' family ' ] == ' RedHat ' and $facts [ ' os ' ][ ' release ' ][ ' major ' ] == ' 7 ' {
131131 $zabbix_version = ' 5.0'
132+ } else {
133+ $zabbix_version = ' 6.0'
132134 }
133135
134136 $manage_startup_script = downcase($facts [' kernel' ]) ? {
Original file line number Diff line number Diff line change 3737 else
3838 '/etc/zabbix/zabbix_agentd.d'
3939 end
40- zabbix_version = '5.0'
41-
4240 let ( :facts ) { facts }
4341
42+ zabbix_version = if facts [ :os ] [ 'family' ] == 'RedHat' && facts [ :os ] [ 'release' ] [ 'major' ] == '7'
43+ '5.0'
44+ else
45+ '6.0'
46+ end
47+
4448 case facts [ :osfamily ]
4549 when 'Gentoo'
4650 package_name = 'zabbix'
Original file line number Diff line number Diff line change 4747 }
4848 end
4949
50- it { is_expected . to contain_class ( 'zabbix::repo' ) . with_zabbix_version ( '5 .0' ) }
50+ it { is_expected . to contain_class ( 'zabbix::repo' ) . with_zabbix_version ( '6 .0' ) }
5151 it { is_expected . to contain_package ( 'zabbix-proxy-pgsql' ) . with_require ( 'Class[Zabbix::Repo]' ) }
5252 it { is_expected . to contain_yumrepo ( 'zabbix-nonsupported' ) }
5353 it { is_expected . to contain_yumrepo ( 'zabbix' ) }
106106 end
107107
108108 it { is_expected . to contain_class ( 'zabbix::database::postgresql' ) . with_zabbix_type ( 'proxy' ) }
109- it { is_expected . to contain_class ( 'zabbix::database::postgresql' ) . with_zabbix_version ( '5 .0' ) }
109+ it { is_expected . to contain_class ( 'zabbix::database::postgresql' ) . with_zabbix_version ( '6 .0' ) }
110110 it { is_expected . to contain_class ( 'zabbix::database::postgresql' ) . with_database_name ( 'zabbix_proxy' ) }
111111 it { is_expected . to contain_class ( 'zabbix::database::postgresql' ) . with_database_user ( 'zabbix-proxy' ) }
112112 it { is_expected . to contain_class ( 'zabbix::database::postgresql' ) . with_database_password ( 'zabbix-proxy' ) }
126126 end
127127
128128 it { is_expected . to contain_class ( 'zabbix::database::mysql' ) . with_zabbix_type ( 'proxy' ) }
129- it { is_expected . to contain_class ( 'zabbix::database::mysql' ) . with_zabbix_version ( '5 .0' ) }
129+ it { is_expected . to contain_class ( 'zabbix::database::mysql' ) . with_zabbix_version ( '6 .0' ) }
130130 it { is_expected . to contain_class ( 'zabbix::database::mysql' ) . with_database_name ( 'zabbix_proxy' ) }
131131 it { is_expected . to contain_class ( 'zabbix::database::mysql' ) . with_database_user ( 'zabbix-proxy' ) }
132132 it { is_expected . to contain_class ( 'zabbix::database::mysql' ) . with_database_password ( 'zabbix-proxy' ) }
Original file line number Diff line number Diff line change 1515 facts
1616 end
1717
18+ zabbix_version = if facts [ :os ] [ 'family' ] == 'RedHat' && facts [ :os ] [ 'release' ] [ 'major' ] == '7'
19+ '5.0'
20+ else
21+ '6.0'
22+ end
23+
1824 context 'with all defaults' do
1925 it { is_expected . to contain_class ( 'zabbix::sender' ) }
2026 it { is_expected . to contain_class ( 'zabbix::params' ) }
3440 if %w[ Archlinux Gentoo ] . include? ( facts [ :osfamily ] )
3541 it { is_expected . not_to compile . with_all_deps }
3642 else
37- it { is_expected . to contain_class ( 'zabbix::repo' ) . with_zabbix_version ( '5.0' ) }
43+ it { is_expected . to contain_class ( 'zabbix::repo' ) . with_zabbix_version ( zabbix_version ) }
3844 it { is_expected . to contain_package ( 'zabbix-sender' ) . with_require ( 'Class[Zabbix::Repo]' ) }
3945 end
4046
Original file line number Diff line number Diff line change 1515 context "on #{ os } " do
1616 let ( :facts ) { facts }
1717
18- zabbix_version = '5.0'
18+ zabbix_version = if facts [ :os ] [ 'family' ] == 'RedHat' && facts [ :os ] [ 'release' ] [ 'major' ] == '7'
19+ '5.0'
20+ else
21+ '6.0'
22+ end
1923
2024 describe 'with default settings' do
2125 it { is_expected . to contain_class ( 'zabbix::repo' ) }
You can’t perform that action at this time.
0 commit comments