Skip to content

Commit a307c0c

Browse files
committed
feat: added smsdevices param
1 parent 383c15e commit a307c0c

File tree

6 files changed

+49
-73
lines changed

6 files changed

+49
-73
lines changed

REFERENCE.md

+21-19
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
#### Public Classes
1010

11-
* [`zabbix`](#zabbix): This will install and configure the zabbix-server on a single host.
1211
* [`zabbix::agent`](#zabbix--agent): This will install and configure the zabbix-agent deamon
1312
* [`zabbix::database`](#zabbix--database): This will install the correct database and one or more users for correct usage
1413
* [`zabbix::database::sqlite`](#zabbix--database--sqlite): Class to handle sqlite database installations zabbix will automatically create a sqlite schema if one does not already exist.
@@ -56,6 +55,8 @@
5655

5756
## Classes
5857

58+
<<<<<<< HEAD
59+
=======
5960
### <a name="zabbix"></a>`zabbix`
6061

6162
This will install and configure the zabbix-server on a single host.
@@ -158,6 +159,7 @@ The following parameters are available in the `zabbix` class:
158159
* [`starttimers`](#-zabbix--starttimers)
159160
* [`javagateway`](#-zabbix--javagateway)
160161
* [`javagatewayport`](#-zabbix--javagatewayport)
162+
* [`smsdevices`](#-zabbix--smsdevices)
161163
* [`startjavapollers`](#-zabbix--startjavapollers)
162164
* [`startlldprocessors`](#-zabbix--startlldprocessors)
163165
* [`startvmwarecollectors`](#-zabbix--startvmwarecollectors)
@@ -830,6 +832,14 @@ Port that zabbix java gateway listens on.
830832

831833
Default value: `$zabbix::params::server_javagatewayport`
832834

835+
##### <a name="-zabbix--smsdevices"></a>`smsdevices`
836+
837+
Data type: `Optional[Array[String]]`
838+
839+
Which devices to use for sms texting
840+
841+
Default value: `$zabbix::params::server_smsdevices`
842+
833843
##### <a name="-zabbix--startjavapollers"></a>`startjavapollers`
834844

835845
Data type: `Any`
@@ -1317,6 +1327,7 @@ A hash of additional SAML SSO settings.
13171327

13181328
Default value: `$zabbix::params::saml_settings`
13191329

1330+
>>>>>>> 8dd1863 (feat: added smsdevices param)
13201331
### <a name="zabbix--agent"></a>`zabbix::agent`
13211332
13221333
This will install and configure the zabbix-agent deamon
@@ -3583,10 +3594,8 @@ The following parameters are available in the `zabbix::repo` class:
35833594
* [`manage_apt`](#-zabbix--repo--manage_apt)
35843595
* [`zabbix_version`](#-zabbix--repo--zabbix_version)
35853596
* [`repo_location`](#-zabbix--repo--repo_location)
3586-
* [`repo_gpg_key_location`](#-zabbix--repo--repo_gpg_key_location)
35873597
* [`frontend_repo_location`](#-zabbix--repo--frontend_repo_location)
35883598
* [`unsupported_repo_location`](#-zabbix--repo--unsupported_repo_location)
3589-
* [`unsupported_repo_gpg_key_location`](#-zabbix--repo--unsupported_repo_gpg_key_location)
35903599

35913600
##### <a name="-zabbix--repo--manage_repo"></a>`manage_repo`
35923601

@@ -3620,14 +3629,6 @@ A custom repo location (e.g. your own mirror)
36203629

36213630
Default value: `$zabbix::params::repo_location`
36223631

3623-
##### <a name="-zabbix--repo--repo_gpg_key_location"></a>`repo_gpg_key_location`
3624-
3625-
Data type: `Optional[Stdlib::HTTPUrl]`
3626-
3627-
A custom repo GPG key location (e.g. an airlocked copy of the gpg key)
3628-
3629-
Default value: `$zabbix::params::repo_gpg_key_location`
3630-
36313632
##### <a name="-zabbix--repo--frontend_repo_location"></a>`frontend_repo_location`
36323633

36333634
Data type: `Optional[Stdlib::HTTPUrl]`
@@ -3645,14 +3646,6 @@ Currently only supported under RedHat based systems.
36453646

36463647
Default value: `$zabbix::params::unsupported_repo_location`
36473648

3648-
##### <a name="-zabbix--repo--unsupported_repo_gpg_key_location"></a>`unsupported_repo_gpg_key_location`
3649-
3650-
Data type: `Optional[Stdlib::HTTPUrl]`
3651-
3652-
A custom repo GPG key location (e.g. an airlocked copy of the gpg key)
3653-
3654-
Default value: `$zabbix::params::unsupported_repo_gpg_key_location`
3655-
36563649
### <a name="zabbix--resources--agent"></a>`zabbix::resources::agent`
36573650

36583651
This will create resources into puppetdb for automatically configuring agent into zabbix front-end.
@@ -4026,6 +4019,7 @@ The following parameters are available in the `zabbix::server` class:
40264019
* [`maxhousekeeperdelete`](#-zabbix--server--maxhousekeeperdelete)
40274020
* [`cachesize`](#-zabbix--server--cachesize)
40284021
* [`cacheupdatefrequency`](#-zabbix--server--cacheupdatefrequency)
4022+
* [`smsdevices`](#-zabbix--server--smsdevices)
40294023
* [`startdbsyncers`](#-zabbix--server--startdbsyncers)
40304024
* [`historycachesize`](#-zabbix--server--historycachesize)
40314025
* [`historyindexcachesize`](#-zabbix--server--historyindexcachesize)
@@ -4622,6 +4616,14 @@ How often zabbix will perform update of configuration cache, in seconds.
46224616

46234617
Default value: `$zabbix::params::server_cacheupdatefrequency`
46244618

4619+
##### <a name="-zabbix--server--smsdevices"></a>`smsdevices`
4620+
4621+
Data type: `Optional[Array[String[1]]]`
4622+
4623+
What devices to use for texting
4624+
4625+
Default value: `$zabbix::params::server_smsdevices`
4626+
46254627
##### <a name="-zabbix--server--startdbsyncers"></a>`startdbsyncers`
46264628

46274629
Data type: `Any`

manifests/init.pp

+3
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116
# @param starttimers Number of pre-forked instances of timers.
117117
# @param javagateway IP address (or hostname) of zabbix java gateway.
118118
# @param javagatewayport Port that zabbix java gateway listens on.
119+
# @param smsdevices Which devices to use for sms texting
119120
# @param startjavapollers Number of pre-forked instances of java pollers.
120121
# @param startlldprocessors Number of pre-forked instances of low-level discovery (LLD) workers.
121122
# @param startvmwarecollectors Number of pre-forked vmware collector instances.
@@ -304,6 +305,7 @@
304305
$cachesize = $zabbix::params::server_cachesize,
305306
$cacheupdatefrequency = $zabbix::params::server_cacheupdatefrequency,
306307
$startdbsyncers = $zabbix::params::server_startdbsyncers,
308+
Optional[Array[String[1]]] $smsdevices = $zabbix::params::server_smsdevices,
307309
$historycachesize = $zabbix::params::server_historycachesize,
308310
Zabbix::Historyics $historyindexcachesize = $zabbix::params::server_historyindexcachesize,
309311
$trendcachesize = $zabbix::params::server_trendcachesize,
@@ -423,6 +425,7 @@
423425
database_port => $database_port,
424426
database_tlsconnect => $database_tlsconnect,
425427
database_tlscafile => $database_tlscafile,
428+
smsdevices => $smsdevices,
426429
startpollers => $startpollers,
427430
startipmipollers => $startipmipollers,
428431
startpollersunreachable => $startpollersunreachable,

manifests/params.pp

+1-2
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,7 @@
150150
$manage_firewall = false
151151
$manage_apt = true
152152
$repo_location = undef
153-
$repo_gpg_key_location = undef
154153
$unsupported_repo_location = undef
155-
$unsupported_repo_gpg_key_location = undef
156154
$frontend_repo_location = undef
157155
$manage_resources = false
158156
$manage_vhost = true
@@ -240,6 +238,7 @@
240238
$server_pacemaker_resource = undef
241239
$server_snmptrapperfile = '/tmp/zabbix_traps.tmp'
242240
$server_sourceip = undef
241+
$server_smsdevices = []
243242
$server_sshkeylocation = undef
244243
$server_sslcertlocation = '/usr/lib/zabbix/ssl/certs'
245244
$server_sslkeylocation = '/usr/lib/zabbix/ssl/keys'

manifests/repo.pp

+18-50
Original file line numberDiff line numberDiff line change
@@ -3,64 +3,37 @@
33
# @param manage_apt Whether the module should manage apt repositories for Debian based systems.
44
# @param zabbix_version This is the zabbix version.
55
# @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)
86
# @param frontend_repo_location A custom repo location for frontend package.
97
# @param unsupported_repo_location
108
# A custom repo location for unsupported content (e.g. your own mirror)
119
# 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)
1410
# @author Werner Dijkerman <[email protected]>
1511
# @author Tim Meusel <[email protected]>
1612
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,
2519
) inherits zabbix::params {
2620
if $manage_repo {
2721
case $facts['os']['family'] {
2822
'RedHat': {
2923
$majorrelease = $facts['os']['release']['major']
3024
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'
3526
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'
4028
} 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'
4530
}
4631
} 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'
5534
} 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'
6437
}
6538

6639
$_repo_location = $repo_location ? {
@@ -73,7 +46,7 @@
7346
descr => "Zabbix_${majorrelease}_${facts['os']['architecture']}",
7447
baseurl => $_repo_location,
7548
gpgcheck => '1',
76-
gpgkey => $_gpgkey_zabbix,
49+
gpgkey => $gpgkey_zabbix,
7750
priority => '1',
7851
}
7952

@@ -87,7 +60,7 @@
8760
descr => "Zabbix_nonsupported_${majorrelease}_${facts['os']['architecture']}",
8861
baseurl => $_unsupported_repo_location,
8962
gpgcheck => '1',
90-
gpgkey => $_gpgkey_nonsupported,
63+
gpgkey => $gpgkey_nonsupported,
9164
priority => '1',
9265
}
9366
}
@@ -118,22 +91,17 @@
11891
default => $repo_location,
11992
}
12093

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-
12694
apt::key { 'zabbix-FBABD5F':
12795
id => 'FBABD5FB20255ECAB22EE194D13D58E479EA5ED4',
128-
source => $_gpgkey_zabbix,
96+
source => 'https://repo.zabbix.com/zabbix-official-repo.key',
12997
}
13098
apt::key { 'zabbix-A1848F5':
13199
id => 'A1848F5352D022B9471D83D0082AB56BA14FE591',
132-
source => $_gpgkey_zabbix,
100+
source => 'https://repo.zabbix.com/zabbix-official-repo.key',
133101
}
134102
apt::key { 'zabbix-4C3D6F2':
135103
id => '4C3D6F2CC75F5146754FC374D913219AB5333005',
136-
source => $_gpgkey_zabbix,
104+
source => 'https://repo.zabbix.com/zabbix-official-repo.key',
137105
}
138106

139107
# Debian 11 provides Zabbix 5.0 by default. This can cause problems for 4.0 versions

manifests/server.pp

+2
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
# if set to 0 then no limit is used at all. in this case you must know what you are doing!
8888
# @param cachesize Size of configuration cache, in bytes.
8989
# @param cacheupdatefrequency How often zabbix will perform update of configuration cache, in seconds.
90+
# @param smsdevices What devices to use for texting
9091
# @param startdbsyncers Number of pre-forked instances of db syncers.
9192
# @param historycachesize Size of history cache, in bytes.
9293
# @param historyindexcachesize Size of history index cache, in bytes.
@@ -204,6 +205,7 @@
204205
Optional[Stdlib::Absolutepath] $database_tlskeyfile = $zabbix::params::server_database_tlskeyfile,
205206
Optional[String[1]] $database_tlscipher = $zabbix::params::server_database_tlscipher,
206207
Optional[String[1]] $database_tlscipher13 = $zabbix::params::server_database_tlscipher13,
208+
Optional[Array[String[1]]] $smsdevices = $zabbix::params::server_smsdevices,
207209
$startpollers = $zabbix::params::server_startpollers,
208210
$startipmipollers = $zabbix::params::server_startipmipollers,
209211
Integer[0, 1000] $startodbcpollers = $zabbix::params::server_startodbcpollers,

templates/zabbix_server.conf.erb

+4-2
Original file line numberDiff line numberDiff line change
@@ -962,8 +962,10 @@ LoadModulePath=<%= @loadmodulepath %>
962962
# Mandatory: no
963963
# Default:
964964
# SMSDevices=
965+
<% if @smsdevices -%>
966+
SMSDevices=<%= @smsdevices.join(',') -%><% end -%>
967+
<% end -%>
965968

966-
<% end %>
967969
<% if @zabbix_version.to_f >= 5.4 %>
968970
####### For advanced users - TCP-related fine-tuning parameters #######
969971

@@ -1017,4 +1019,4 @@ LoadModulePath=<%= @loadmodulepath %>
10171019
# Default:
10181020
# StartBrowserPollers=1
10191021

1020-
<% end %>
1022+
<% end %>

0 commit comments

Comments
 (0)