|
83 | 83 | it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_baseurl('https://example.com/foo') }
|
84 | 84 | end
|
85 | 85 |
|
86 |
| - case facts[:os]['release']['major'] |
87 |
| - when '7' |
88 |
| - context 'on RedHat 7 and Zabbix 5.0' do |
89 |
| - let :params do |
90 |
| - { |
91 |
| - zabbix_version: '5.0', |
92 |
| - manage_repo: true |
93 |
| - } |
94 |
| - end |
| 86 | + major = facts[:os]['release']['major'] |
| 87 | + context "on RedHat #{major} and Zabbix 5.0" do |
| 88 | + let :params do |
| 89 | + { |
| 90 | + zabbix_version: '5.0', |
| 91 | + manage_repo: true |
| 92 | + } |
| 93 | + end |
95 | 94 |
|
96 |
| - it { is_expected.to contain_yumrepo('zabbix').with_baseurl('https://repo.zabbix.com/zabbix/5.0/rhel/7/$basearch/') } |
97 |
| - it { is_expected.to contain_yumrepo('zabbix').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-A14FE591') } |
98 |
| - it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_baseurl('https://repo.zabbix.com/non-supported/rhel/7/$basearch/') } |
99 |
| - it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-79EA5ED4') } |
100 |
| - it { is_expected.to contain_yumrepo('zabbix-frontend') } |
| 95 | + it { is_expected.to contain_yumrepo('zabbix').with_baseurl("https://repo.zabbix.com/zabbix/5.0/rhel/#{major}/$basearch/") } |
101 | 96 |
|
102 |
| - it { is_expected.to contain_package('zabbix-required-scl-repo').with_ensure('latest').with_name('centos-release-scl') } if facts[:os]['name'] == 'CentOS' |
103 |
| - it { is_expected.to contain_package('zabbix-required-scl-repo').with_ensure('latest').with_name('oracle-softwarecollection-release-el7') } if facts[:os]['name'] == 'OracleLinux' |
104 |
| - end |
105 |
| - when '9' |
| 97 | + it { is_expected.to contain_yumrepo('zabbix').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-A14FE591') } if facts[:os]['release']['major'].to_i < 9 |
| 98 | + it { is_expected.to contain_yumrepo('zabbix').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') } if facts[:os]['release']['major'].to_i >= 9 |
106 | 99 |
|
107 |
| - context 'on RedHat 9 and Zabbix 5.0' do |
108 |
| - let :params do |
109 |
| - { |
110 |
| - zabbix_version: '5.0', |
111 |
| - manage_repo: true |
112 |
| - } |
113 |
| - end |
| 100 | + it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_baseurl("https://repo.zabbix.com/non-supported/rhel/#{major}/$basearch/") } |
114 | 101 |
|
115 |
| - it { is_expected.to contain_yumrepo('zabbix').with_baseurl('https://repo.zabbix.com/zabbix/5.0/rhel/9/$basearch/') } |
116 |
| - it { is_expected.to contain_yumrepo('zabbix').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') } |
117 |
| - it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_baseurl('https://repo.zabbix.com/non-supported/rhel/9/$basearch/') } |
118 |
| - it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') } |
| 102 | + it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-79EA5ED4') } if facts[:os]['release']['major'].to_i < 9 |
| 103 | + it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') } if facts[:os]['release']['major'].to_i >= 9 |
| 104 | + end |
| 105 | + |
| 106 | + context "on RedHat #{major} and Zabbix 6.0" do |
| 107 | + let :params do |
| 108 | + { |
| 109 | + zabbix_version: '6.0', |
| 110 | + manage_repo: true |
| 111 | + } |
119 | 112 | end
|
120 | 113 |
|
121 |
| - context 'on RedHat 9 and Zabbix 6.0' do |
122 |
| - let :params do |
123 |
| - { |
124 |
| - zabbix_version: '6.0', |
125 |
| - manage_repo: true |
126 |
| - } |
127 |
| - end |
| 114 | + it { is_expected.to contain_yumrepo('zabbix').with_baseurl("https://repo.zabbix.com/zabbix/6.0/rhel/#{major}/$basearch/") } |
128 | 115 |
|
129 |
| - it { is_expected.to contain_yumrepo('zabbix').with_baseurl('https://repo.zabbix.com/zabbix/6.0/rhel/9/$basearch/') } |
130 |
| - it { is_expected.to contain_yumrepo('zabbix').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') } |
131 |
| - it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_baseurl('https://repo.zabbix.com/non-supported/rhel/9/$basearch/') } |
132 |
| - it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') } |
| 116 | + it { is_expected.to contain_yumrepo('zabbix').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-A14FE591') } if facts[:os]['release']['major'].to_i < 9 |
| 117 | + it { is_expected.to contain_yumrepo('zabbix').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') } if facts[:os]['release']['major'].to_i >= 9 |
| 118 | + |
| 119 | + it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_baseurl("https://repo.zabbix.com/non-supported/rhel/#{major}/$basearch/") } |
| 120 | + |
| 121 | + it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-79EA5ED4') } if facts[:os]['release']['major'].to_i < 9 |
| 122 | + it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') } if facts[:os]['release']['major'].to_i >= 9 |
| 123 | + end |
| 124 | + |
| 125 | + context "on RedHat #{major} and Zabbix 7.0" do |
| 126 | + let :params do |
| 127 | + { |
| 128 | + zabbix_version: '7.0', |
| 129 | + manage_repo: true |
| 130 | + } |
133 | 131 | end
|
| 132 | + |
| 133 | + it { is_expected.to contain_yumrepo('zabbix').with_baseurl("https://repo.zabbix.com/zabbix/7.0/rhel/#{major}/$basearch/") } |
| 134 | + it { is_expected.to contain_yumrepo('zabbix').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-B5333005') } |
| 135 | + it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_baseurl("https://repo.zabbix.com/non-supported/rhel/#{major}/$basearch/") } |
| 136 | + |
| 137 | + it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-B5333005') } if facts[:os]['release']['major'].to_i < 9 |
| 138 | + it { is_expected.to contain_yumrepo('zabbix-nonsupported').with_gpgkey('https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD') } if facts[:os]['release']['major'].to_i >= 9 |
134 | 139 | end
|
135 | 140 | end
|
136 | 141 | end
|
|
0 commit comments