mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 04:23:46 +00:00
puppet: Abstract out nagios plugins directory.
This commit is contained in:
@@ -10,14 +10,17 @@ class zulip::app_frontend_base {
|
||||
]
|
||||
zulip::safepackage { $web_packages: ensure => 'installed' }
|
||||
|
||||
$nagios_plugins = $::osfamily ? {
|
||||
'debian' => 'nagios-plugins-basic',
|
||||
'redhat' => 'nagios-plugins',
|
||||
}
|
||||
|
||||
$nginx = $::osfamily ? {
|
||||
'debian' => 'nginx-full',
|
||||
'redhat' => 'nginx',
|
||||
case $::osfamily {
|
||||
'debian': {
|
||||
$nagios_plugins = 'nagios-plugins-basic'
|
||||
$nagios_plugins_dir = '/usr/lib/nagios/plugins'
|
||||
$nginx = 'nginx-full'
|
||||
}
|
||||
'redhat': {
|
||||
$nagios_plugins = 'nagios-plugins'
|
||||
$nagios_plugins_dir = '/usr/lib64/nagios/plugins'
|
||||
$nginx = 'nginx'
|
||||
}
|
||||
}
|
||||
|
||||
file { '/etc/nginx/zulip-include/app':
|
||||
@@ -145,7 +148,7 @@ class zulip::app_frontend_base {
|
||||
file { '/etc/cron.d/email-mirror':
|
||||
ensure => absent,
|
||||
}
|
||||
file { '/usr/lib/nagios/plugins/zulip_app_frontend':
|
||||
file { "${nagios_plugins_dir}/zulip_app_frontend":
|
||||
require => Package[$nagios_plugins],
|
||||
recurse => true,
|
||||
purge => true,
|
||||
|
||||
@@ -34,6 +34,7 @@ class zulip::base {
|
||||
'cron',
|
||||
]
|
||||
$nagios_plugins = 'nagios-plugins-basic'
|
||||
$nagios_plugins_dir = '/usr/lib/nagios/plugins'
|
||||
}
|
||||
'redhat': {
|
||||
$release_name = "${::operatingsystem}${::operatingsystemmajrelease}"
|
||||
@@ -48,6 +49,7 @@ class zulip::base {
|
||||
'cronie'
|
||||
]
|
||||
$nagios_plugins = 'nagios-plugins'
|
||||
$nagios_plugins_dir = '/usr/lib64/nagios/plugins'
|
||||
}
|
||||
default: {
|
||||
fail('osfamily not supported')
|
||||
@@ -157,7 +159,7 @@ class zulip::base {
|
||||
mode => '0640',
|
||||
}
|
||||
|
||||
file { '/usr/lib/nagios/plugins/zulip_base':
|
||||
file { "${nagios_plugins_dir}/zulip_base":
|
||||
require => Package[$nagios_plugins],
|
||||
recurse => true,
|
||||
purge => true,
|
||||
|
||||
@@ -3,11 +3,17 @@
|
||||
#
|
||||
# Depends on zulip::base to have installed `nagios-plugins-basic`.
|
||||
class zulip::nagios {
|
||||
$nagios_plugins = $::osfamily ? {
|
||||
'debian' => 'nagios-plugins-basic',
|
||||
'redhat' => 'nagios-plugins',
|
||||
case $::osfamily {
|
||||
'debian': {
|
||||
$nagios_plugins = 'nagios-plugins-basic'
|
||||
$nagios_plugins_dir = '/usr/lib/nagios/plugins'
|
||||
}
|
||||
'redhat': {
|
||||
$nagios_plugins = 'nagios-plugins'
|
||||
$nagios_plugins_dir = '/usr/lib64/nagios/plugins'
|
||||
}
|
||||
}
|
||||
file { '/usr/lib/nagios/plugins/zulip_nagios_server':
|
||||
file { "${nagios_plugins_dir}/zulip_nagios_server":
|
||||
require => Package[$nagios_plugins],
|
||||
recurse => true,
|
||||
purge => true,
|
||||
|
||||
@@ -63,7 +63,7 @@ class zulip::postgres_appdb_base {
|
||||
mode => '0644',
|
||||
source => 'puppet:///modules/zulip/postgresql/zulip_english.stop',
|
||||
}
|
||||
file { '/usr/lib/nagios/plugins/zulip_postgres_appdb':
|
||||
file { "${zulip::postgres_common:nagios_plugins_dir}/zulip_postgres_appdb":
|
||||
require => Package[$zulip::postgres_common::nagios_plugins],
|
||||
recurse => true,
|
||||
purge => true,
|
||||
|
||||
@@ -2,6 +2,7 @@ class zulip::postgres_common {
|
||||
case $::osfamily {
|
||||
'debian': {
|
||||
$nagios_plugins = 'nagios-plugins-basic'
|
||||
$nagios_plugins_dir = '/usr/lib/nagios/plugins'
|
||||
$postgresql = "postgresql-${zulip::base::postgres_version}"
|
||||
$postgres_packages = [
|
||||
# The database itself
|
||||
@@ -23,6 +24,7 @@ class zulip::postgres_common {
|
||||
}
|
||||
'redhat': {
|
||||
$nagios_plugins = 'nagios-plugins'
|
||||
$nagios_plugins_dir = '/usr/lib64/nagios/plugins'
|
||||
$postgresql = "postgresql${zulip::base::postgres_version}"
|
||||
$postgres_packages = [
|
||||
$postgresql,
|
||||
@@ -61,7 +63,7 @@ class zulip::postgres_common {
|
||||
creates => '/etc/logrotate.d/postgresql-common.disabled',
|
||||
}
|
||||
}
|
||||
file { '/usr/lib/nagios/plugins/zulip_postgres_common':
|
||||
file { "${nagios_plugins_dir}/zulip_postgres_common":
|
||||
require => Package[$nagios_plugins],
|
||||
recurse => true,
|
||||
purge => true,
|
||||
|
||||
Reference in New Issue
Block a user