Skip to content

Commit a62300d

Browse files
committed
puppet-lint: autofix
1 parent 818af96 commit a62300d

File tree

17 files changed

+106
-127
lines changed

17 files changed

+106
-127
lines changed

manifests/agent.pp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,6 @@
309309
String $service_type = $zabbix::params::service_type,
310310
Boolean $manage_startup_script = $zabbix::params::manage_startup_script,
311311
) inherits zabbix::params {
312-
313312
# the following two codeblocks are a bit blargh. The correct default value for
314313
# $real_additional_service_params and $type changes based on the value of $zabbix_version
315314
# We handle this in the params.pp, but that doesn't work if somebody provides a specific
@@ -408,13 +407,13 @@
408407
ensure => $zabbix_package_state,
409408
require => Class['zabbix::repo'],
410409
tag => 'zabbix',
411-
provider => $zabbix_package_provider,
410+
provider => $zabbix_package_provider,
412411
}
413412
}
414413

415414
# Ensure that the correct config file is used.
416415
if $manage_startup_script {
417-
zabbix::startup {$servicename:
416+
zabbix::startup { $servicename:
418417
pidfile => $pidfile,
419418
agent_configfile_path => $agent_configfile_path,
420419
zabbix_user => $zabbix_user,
@@ -488,14 +487,15 @@
488487
state => [
489488
'NEW',
490489
'RELATED',
491-
'ESTABLISHED'],
490+
'ESTABLISHED',
491+
],
492492
}
493493
}
494494
}
495495
# the agent doesn't work perfectly fine with selinux
496496
# https://support.zabbix.com/browse/ZBX-11631
497497
if fact('os.selinux.enabled') == true and $manage_selinux {
498-
selinux::module{'zabbix-agent':
498+
selinux::module { 'zabbix-agent':
499499
ensure => 'present',
500500
content_te => template('zabbix/selinux/zabbix-agent.te.erb'),
501501
before => Service[$servicename],

manifests/database.pp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
#
115115
# Copyright 2014 Werner Dijkerman
116116
#
117-
class zabbix::database(
117+
class zabbix::database (
118118
$zabbix_type = 'server',
119119
$zabbix_web = $zabbix::params::zabbix_web,
120120
$zabbix_web_ip = $zabbix::params::zabbix_web_ip,
@@ -134,7 +134,6 @@
134134
$database_collate = $zabbix::params::server_database_collate,
135135
Optional[String[1]] $database_tablespace = $zabbix::params::server_database_tablespace,
136136
) inherits zabbix::params {
137-
138137
# So lets create the databases and load all files. This can only be
139138
# happen when manage_database is set to true (Default).
140139
if $manage_database == true {
@@ -156,7 +155,7 @@
156155
}
157156

158157
# When database not in some server with zabbix server include pg_hba_rule to server
159-
if ($database_host_ip != $zabbix_server_ip) or ($zabbix_web_ip != $zabbix_server_ip){
158+
if ($database_host_ip != $zabbix_server_ip) or ($zabbix_web_ip != $zabbix_server_ip) {
160159
postgresql::server::pg_hba_rule { 'Allow zabbix-server to access database':
161160
description => 'Open up postgresql for access from zabbix-server',
162161
type => 'host',

manifests/database/mysql.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
$database_user = '',
2424
$database_password = '',
2525
$database_host = '',
26-
$database_path = $zabbix::params::database_path,) inherits zabbix::params {
27-
26+
$database_path = $zabbix::params::database_path,
27+
) inherits zabbix::params {
2828
assert_private()
2929

3030
#

manifests/database/postgresql.pp

Lines changed: 30 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
$database_host = '',
2626
$database_path = $zabbix::params::database_path,
2727
) inherits zabbix::params {
28-
2928
assert_private()
3029

3130
#
@@ -99,46 +98,38 @@
9998
}
10099

101100
case $zabbix_type {
102-
'proxy': {
103-
exec { 'zabbix_proxy_create.sql':
104-
command => $zabbix_proxy_create_sql,
105-
path => "/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:${database_path}",
106-
unless => 'test -f /etc/zabbix/.schema.done',
107-
provider => 'shell',
108-
require => [
109-
Exec['update_pgpass'],
110-
],
111-
}
101+
'proxy': {
102+
exec { 'zabbix_proxy_create.sql':
103+
command => $zabbix_proxy_create_sql,
104+
path => "/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:${database_path}",
105+
unless => 'test -f /etc/zabbix/.schema.done',
106+
provider => 'shell',
107+
require => Exec['update_pgpass'],
112108
}
113-
'server': {
114-
exec { 'zabbix_server_create.sql':
115-
command => $zabbix_server_create_sql,
116-
path => "/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:${database_path}",
117-
unless => 'test -f /etc/zabbix/.schema.done',
118-
provider => 'shell',
119-
require => [
120-
Exec['update_pgpass'],
121-
],
122-
}
123-
-> exec { 'zabbix_server_images.sql':
124-
command => $zabbix_server_images_sql,
125-
path => "/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:${database_path}",
126-
unless => 'test -f /etc/zabbix/.images.done',
127-
provider => 'shell',
128-
require => [
129-
Exec['update_pgpass'],
130-
],
131-
}
132-
-> exec { 'zabbix_server_data.sql':
133-
command => $zabbix_server_data_sql,
134-
path => "/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:${database_path}",
135-
unless => 'test -f /etc/zabbix/.data.done',
136-
provider => 'shell',
137-
require => [
138-
Exec['update_pgpass'],
139-
],
140-
}
109+
}
110+
'server': {
111+
exec { 'zabbix_server_create.sql':
112+
command => $zabbix_server_create_sql,
113+
path => "/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:${database_path}",
114+
unless => 'test -f /etc/zabbix/.schema.done',
115+
provider => 'shell',
116+
require => Exec['update_pgpass'],
117+
}
118+
-> exec { 'zabbix_server_images.sql':
119+
command => $zabbix_server_images_sql,
120+
path => "/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:${database_path}",
121+
unless => 'test -f /etc/zabbix/.images.done',
122+
provider => 'shell',
123+
require => Exec['update_pgpass'],
141124
}
125+
-> exec { 'zabbix_server_data.sql':
126+
command => $zabbix_server_data_sql,
127+
path => "/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:${database_path}",
128+
unless => 'test -f /etc/zabbix/.data.done',
129+
provider => 'shell',
130+
require => Exec['update_pgpass'],
131+
}
132+
}
142133
default: {
143134
fail 'We do not work.'
144135
}

manifests/database/sqlite.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
#
1717
# Copyright 2014 Werner Dijkerman
1818
#
19-
class zabbix::database::sqlite () { }
19+
class zabbix::database::sqlite () {}

manifests/init.pp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@
181181
Optional[String[1]] $zabbix_user = $zabbix::params::server_zabbix_user,
182182
Optional[String] $zabbix_server_name = $zabbix::params::zabbix_server,
183183
) inherits zabbix::params {
184-
185184
class { 'zabbix::web':
186185
zabbix_url => $zabbix_url,
187186
database_type => $database_type,
@@ -320,5 +319,4 @@
320319
database_collate => $database_collate,
321320
database_tablespace => $database_tablespace,
322321
}
323-
324322
}

manifests/javagateway.pp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
#
5151
# Copyright 2014 Werner Dijkerman
5252
#
53-
class zabbix::javagateway(
53+
class zabbix::javagateway (
5454
$zabbix_version = $zabbix::params::zabbix_version,
5555
$zabbix_package_state = $zabbix::params::zabbix_package_state,
5656
Boolean $manage_firewall = $zabbix::params::manage_firewall,
@@ -60,8 +60,7 @@
6060
$listenport = $zabbix::params::javagateway_listenport,
6161
$startpollers = $zabbix::params::javagateway_startpollers,
6262
$timeout = $zabbix::params::javagateway_timeout,
63-
) inherits zabbix::params {
64-
63+
) inherits zabbix::params {
6564
# Only include the repo class if it has not yet been included
6665
unless defined(Class['Zabbix::Repo']) {
6766
class { 'zabbix::repo':

manifests/params.pp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -326,11 +326,9 @@
326326
$agent_userparameter = undef
327327
$agent_zabbix_alias = undef
328328
$agent_zbx_group = 'Linux servers'
329-
$agent_zbx_groups = [ 'Linux servers', ]
329+
$agent_zbx_groups = ['Linux servers',]
330330
$agent_zbx_group_create = true
331-
$agent_zbx_templates = [
332-
'Template OS Linux',
333-
'Template App SSH Service']
331+
$agent_zbx_templates = ['Template OS Linux', 'Template App SSH Service']
334332
$apache_status = false
335333
$monitored_by_proxy = undef
336334
# provided by camp2camp/systemd
@@ -437,7 +435,7 @@
437435

438436
# SE Linux specific params
439437
$selinux_require = ['type zabbix_agent_t', 'class process setrlimit', 'class unix_dgram_socket create']
440-
$selinux_rules = { 'zabbix_agent_t' => ['allow zabbix_agent_t self:process setrlimit', 'allow zabbix_agent_t self:unix_dgram_socket create']}
438+
$selinux_rules = { 'zabbix_agent_t' => ['allow zabbix_agent_t self:process setrlimit', 'allow zabbix_agent_t self:unix_dgram_socket create'] }
441439

442440
$manage_selinux = fact('os.selinux.enabled') ? {
443441
true => true,

manifests/proxy.pp

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,7 @@
423423
$loadmodulepath = $zabbix::params::proxy_loadmodulepath,
424424
$loadmodule = $zabbix::params::proxy_loadmodule,
425425
Boolean $manage_selinux = $zabbix::params::manage_selinux,
426-
) inherits zabbix::params {
427-
426+
) inherits zabbix::params {
428427
# check osfamily, Arch is currently not supported for web
429428
if $facts['os']['family'] == 'Archlinux' {
430429
fail('Archlinux is currently not supported for zabbix::proxy ')
@@ -524,7 +523,8 @@
524523
}
525524

526525
Package["zabbix-proxy-${db}"] {
527-
require => Class['zabbix::repo'] }
526+
require => Class['zabbix::repo']
527+
}
528528
}
529529

530530
# Now we are going to install the correct packages.
@@ -564,40 +564,39 @@
564564
subscribe => [
565565
File[$proxy_configfile_path],
566566
Class['zabbix::database']
567-
],
567+
],
568568
require => [
569569
Package["zabbix-proxy-${db}"],
570570
File[$include_dir],
571571
File[$proxy_configfile_path],
572572
Class['zabbix::database']
573-
],
573+
],
574574
}
575575
}
576576

577-
578577
$before_database = $manage_service ? {
579578
true => [
580579
Service[$proxy_service_name],
581580
Class["zabbix::database::${database_type}"]
582-
],
581+
],
583582
false => Class["zabbix::database::${database_type}"],
584583
}
585584

586585
# if we want to manage the databases, we do
587586
# some stuff. (for maintaining database only.)
588-
if $manage_database {
589-
class { 'zabbix::database':
590-
database_type => $database_type,
591-
zabbix_type => 'proxy',
592-
database_name => $database_name,
593-
database_user => $database_user,
594-
database_password => $database_password,
595-
database_host => $database_host,
596-
zabbix_proxy => $zabbix_proxy,
597-
zabbix_proxy_ip => $zabbix_proxy_ip,
598-
before => $before_database,
599-
}
587+
if $manage_database {
588+
class { 'zabbix::database':
589+
database_type => $database_type,
590+
zabbix_type => 'proxy',
591+
database_name => $database_name,
592+
database_user => $database_user,
593+
database_password => $database_password,
594+
database_host => $database_host,
595+
zabbix_proxy => $zabbix_proxy,
596+
zabbix_proxy_ip => $zabbix_proxy_ip,
597+
before => $before_database,
600598
}
599+
}
601600

602601
# Configuring the zabbix-proxy configuration file
603602
file { $proxy_configfile_path:
@@ -625,16 +624,16 @@
625624
state => [
626625
'NEW',
627626
'RELATED',
628-
'ESTABLISHED'],
627+
'ESTABLISHED',
628+
],
629629
}
630630
}
631631

632632
# check if selinux is active and allow zabbix
633633
if fact('os.selinux.enabled') == true and $manage_selinux {
634-
selboolean{'zabbix_can_network':
634+
selboolean { 'zabbix_can_network':
635635
persistent => true,
636636
value => 'on',
637637
}
638638
}
639-
640639
}

manifests/repo.pp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@
9292
gpgkey => $gpgkey_nonsupported,
9393
priority => '1',
9494
}
95-
9695
}
9796
'Debian' : {
9897
if ($manage_apt) {

0 commit comments

Comments
 (0)