Skip to content

Commit

Permalink
Merge pull request #268 from voxpupuli/modulesync
Browse files Browse the repository at this point in the history
modulesync 0.12.2 + Improvements
  • Loading branch information
jyaworski committed Aug 27, 2016
2 parents 7395f66 + 112fc0d commit fae91e7
Show file tree
Hide file tree
Showing 9 changed files with 638 additions and 440 deletions.
4 changes: 3 additions & 1 deletion manifests/agent.pp
Expand Up @@ -315,7 +315,9 @@

# Ensure that the correct config file is used.
zabbix::startup {'zabbix-agent':
require => Package[$zabbix_package_agent],
pidfile => $pidfile,
agent_configfile_path => $agent_configfile_path,
require => Package[$zabbix_package_agent],
}

if $agent_configfile_path != '/etc/zabbix/zabbix_agentd.conf' {
Expand Down
2 changes: 1 addition & 1 deletion manifests/params.pp
Expand Up @@ -26,7 +26,7 @@
$server_fping6location = '/usr/bin/fping6'
$proxy_fpinglocation = '/usr/bin/fping'
$proxy_fping6location = '/usr/bin/fping6'
$manage_repo = false
$manage_repo = false
$zabbix_package_agent = 'zabbix3-agent'

}
Expand Down
2 changes: 1 addition & 1 deletion manifests/repo.pp
Expand Up @@ -108,7 +108,7 @@
Class['Apt::Update'] -> Package<|tag == 'zabbix'|>
}
default : {
fail('Unrecognized operating system for webserver')
fail("Managing a repo on ${::osfamily} is currently not implemented")
}
}
} # end if ($manage_repo)
Expand Down
7 changes: 5 additions & 2 deletions manifests/server.pp
Expand Up @@ -436,7 +436,10 @@

# Ensure that the correct config file is used.
zabbix::startup {'zabbix-server':
require => Package["zabbix-server-${db}"],
pidfile => $pidfile,
database_type => $database_type,
server_configfile_path => $server_configfile_path,
require => Package["zabbix-server-${db}"],
}

if $server_configfile_path != '/etc/zabbix/zabbix_server.conf' {
Expand Down Expand Up @@ -532,7 +535,7 @@
}

# check if selinux is active and allow zabbix
if $::osfamily == 'RedHat' and $::selinux_config_mode == 'enforcing' {
if $::selinux_config_mode == 'enforcing' {
selboolean{'zabbix_can_network':
persistent => true,
value => 'on',
Expand Down
40 changes: 30 additions & 10 deletions manifests/startup.pp
Expand Up @@ -11,16 +11,34 @@
# zabbix::startup { 'agent':
# }
#
# === Authors
#
# Author Name: ikben@werner-dijkerman.nl
#
# === Copyright
#
# Copyright 2014 Werner Dijkerman
#
define zabbix::startup {
define zabbix::startup (
$pidfile = undef,
$agent_configfile_path = undef,
$server_configfile_path = undef,
$database_type = undef,
) {
case $title {
/agent/: {
unless $agent_configfile_path {
fail('you have to provide a agent_configfile_path param')
}
}
/server/: {
unless $server_configfile_path {
fail('you have to provide a server_configfile_path param')
}
unless $database_type {
fail('you have to provide a database_type param')
}
}
default: {
fail('we currently only spport a title that contains agent or server')
}
}
if str2bool($::systemd) {
unless $pidfile {
fail('you have to provide a pidfile param')
}
contain ::systemd
file { "/etc/systemd/system/${name}.service":
ensure => file,
Expand All @@ -39,5 +57,7 @@
mode => '0755',
content => template("zabbix/${name}-${osfamily_downcase}.init.erb"),
}
} else {
fail('We currently only support Debian and RedHat osfamily as non-systemd')
}
}
}

0 comments on commit fae91e7

Please sign in to comment.