|
3 | 3 | # @param manage_apt Whether the module should manage apt repositories for Debian based systems.
|
4 | 4 | # @param zabbix_version This is the zabbix version.
|
5 | 5 | # @param repo_location A custom repo location (e.g. your own mirror)
|
6 |
| -# @param repo_gpg_key_location |
7 |
| -# A custom repo GPG key location (e.g. an airlocked copy of the gpg key) |
8 | 6 | # @param frontend_repo_location A custom repo location for frontend package.
|
9 | 7 | # @param unsupported_repo_location
|
10 | 8 | # A custom repo location for unsupported content (e.g. your own mirror)
|
11 | 9 | # Currently only supported under RedHat based systems.
|
12 |
| -# @param unsupported_repo_gpg_key_location |
13 |
| -# A custom repo GPG key location (e.g. an airlocked copy of the gpg key) |
14 | 10 | # @author Werner Dijkerman <[email protected]>
|
15 | 11 | # @author Tim Meusel <[email protected]>
|
16 | 12 | class zabbix::repo (
|
17 |
| - Boolean $manage_repo = $zabbix::params::manage_repo, |
18 |
| - Boolean $manage_apt = $zabbix::params::manage_apt, |
19 |
| - Optional[Stdlib::HTTPUrl] $repo_location = $zabbix::params::repo_location, |
20 |
| - Optional[Stdlib::HTTPUrl] $repo_gpg_key_location = $zabbix::params::repo_gpg_key_location, |
21 |
| - Optional[Stdlib::HTTPUrl] $frontend_repo_location = $zabbix::params::frontend_repo_location, |
22 |
| - Optional[Stdlib::HTTPUrl] $unsupported_repo_location = $zabbix::params::unsupported_repo_location, |
23 |
| - Optional[Stdlib::HTTPUrl] $unsupported_repo_gpg_key_location = $zabbix::params::unsupported_repo_gpg_key_location, |
24 |
| - String[1] $zabbix_version = $zabbix::params::zabbix_version, |
| 13 | + Boolean $manage_repo = $zabbix::params::manage_repo, |
| 14 | + Boolean $manage_apt = $zabbix::params::manage_apt, |
| 15 | + Optional[Stdlib::HTTPUrl] $repo_location = $zabbix::params::repo_location, |
| 16 | + Optional[Stdlib::HTTPUrl] $frontend_repo_location = $zabbix::params::frontend_repo_location, |
| 17 | + Optional[Stdlib::HTTPUrl] $unsupported_repo_location = $zabbix::params::unsupported_repo_location, |
| 18 | + String[1] $zabbix_version = $zabbix::params::zabbix_version, |
25 | 19 | ) inherits zabbix::params {
|
26 | 20 | if $manage_repo {
|
27 | 21 | case $facts['os']['family'] {
|
28 | 22 | 'RedHat': {
|
29 | 23 | $majorrelease = $facts['os']['release']['major']
|
30 | 24 | if versioncmp($zabbix_version, '7.0') >= 0 {
|
31 |
| - $_gpgkey_zabbix = $repo_gpg_key_location ? { |
32 |
| - undef => 'https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-B5333005', |
33 |
| - default => "${repo_gpg_key_location}/RPM-GPG-KEY-ZABBIX-B5333005", |
34 |
| - } |
| 25 | + $gpgkey_zabbix = 'https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-B5333005' |
35 | 26 | if versioncmp(fact('os.release.major'), '9') >= 0 {
|
36 |
| - $_gpgkey_nonsupported = $unsupported_repo_gpg_key_location ? { |
37 |
| - undef => 'https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD', |
38 |
| - default => "${unsupported_repo_gpg_key_location}/RPM-GPG-KEY-ZABBIX-08EFA7DD", |
39 |
| - } |
| 27 | + $gpgkey_nonsupported = 'https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD' |
40 | 28 | } else {
|
41 |
| - $_gpgkey_nonsupported = $unsupported_repo_gpg_key_location ? { |
42 |
| - undef => 'https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-B5333005', |
43 |
| - default => "${unsupported_repo_gpg_key_location}/RPM-GPG-KEY-ZABBIX-B5333005", |
44 |
| - } |
| 29 | + $gpgkey_nonsupported = 'https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-B5333005' |
45 | 30 | }
|
46 | 31 | } elsif versioncmp(fact('os.release.major'), '9') >= 0 {
|
47 |
| - $_gpgkey_zabbix = $repo_gpg_key_location ? { |
48 |
| - undef => 'https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD', |
49 |
| - default => "${repo_gpg_key_location}/RPM-GPG-KEY-ZABBIX-08EFA7DD", |
50 |
| - } |
51 |
| - $_gpgkey_nonsupported = $unsupported_repo_gpg_key_location ? { |
52 |
| - undef => 'https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD', |
53 |
| - default => "${unsupported_repo_gpg_key_location}/RPM-GPG-KEY-ZABBIX-08EFA7DD", |
54 |
| - } |
| 32 | + $gpgkey_zabbix = 'https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD' |
| 33 | + $gpgkey_nonsupported = 'https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-08EFA7DD' |
55 | 34 | } else {
|
56 |
| - $_gpgkey_zabbix = $repo_gpg_key_location ? { |
57 |
| - undef => 'https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-A14FE591', |
58 |
| - default => "${repo_gpg_key_location}/RPM-GPG-KEY-ZABBIX-A14FE591", |
59 |
| - } |
60 |
| - $_gpgkey_nonsupported = $unsupported_repo_gpg_key_location ? { |
61 |
| - undef => 'https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-79EA5ED4', |
62 |
| - default => "${unsupported_repo_gpg_key_location}/RPM-GPG-KEY-ZABBIX-79EA5ED4", |
63 |
| - } |
| 35 | + $gpgkey_zabbix = 'https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-A14FE591' |
| 36 | + $gpgkey_nonsupported = 'https://repo.zabbix.com/RPM-GPG-KEY-ZABBIX-79EA5ED4' |
64 | 37 | }
|
65 | 38 |
|
66 | 39 | $_repo_location = $repo_location ? {
|
|
73 | 46 | descr => "Zabbix_${majorrelease}_${facts['os']['architecture']}",
|
74 | 47 | baseurl => $_repo_location,
|
75 | 48 | gpgcheck => '1',
|
76 |
| - gpgkey => $_gpgkey_zabbix, |
| 49 | + gpgkey => $gpgkey_zabbix, |
77 | 50 | priority => '1',
|
78 | 51 | }
|
79 | 52 |
|
|
87 | 60 | descr => "Zabbix_nonsupported_${majorrelease}_${facts['os']['architecture']}",
|
88 | 61 | baseurl => $_unsupported_repo_location,
|
89 | 62 | gpgcheck => '1',
|
90 |
| - gpgkey => $_gpgkey_nonsupported, |
| 63 | + gpgkey => $gpgkey_nonsupported, |
91 | 64 | priority => '1',
|
92 | 65 | }
|
93 | 66 | }
|
|
118 | 91 | default => $repo_location,
|
119 | 92 | }
|
120 | 93 |
|
121 |
| - $_gpgkey_zabbix = $repo_gpg_key_location ? { |
122 |
| - undef => 'https://repo.zabbix.com/zabbix-official-repo.key', |
123 |
| - default => "${repo_gpg_key_location}/zabbix-official-repo.key", |
124 |
| - } |
125 |
| - |
126 | 94 | apt::key { 'zabbix-FBABD5F':
|
127 | 95 | id => 'FBABD5FB20255ECAB22EE194D13D58E479EA5ED4',
|
128 |
| - source => $_gpgkey_zabbix, |
| 96 | + source => 'https://repo.zabbix.com/zabbix-official-repo.key', |
129 | 97 | }
|
130 | 98 | apt::key { 'zabbix-A1848F5':
|
131 | 99 | id => 'A1848F5352D022B9471D83D0082AB56BA14FE591',
|
132 |
| - source => $_gpgkey_zabbix, |
| 100 | + source => 'https://repo.zabbix.com/zabbix-official-repo.key', |
133 | 101 | }
|
134 | 102 | apt::key { 'zabbix-4C3D6F2':
|
135 | 103 | id => '4C3D6F2CC75F5146754FC374D913219AB5333005',
|
136 |
| - source => $_gpgkey_zabbix, |
| 104 | + source => 'https://repo.zabbix.com/zabbix-official-repo.key', |
137 | 105 | }
|
138 | 106 |
|
139 | 107 | # Debian 11 provides Zabbix 5.0 by default. This can cause problems for 4.0 versions
|
|
0 commit comments