puppet: Abstract out nagios-plugins package.

This commit is contained in:
rht 2019-01-04 21:59:13 +00:00 committed by Tim Abbott
parent 04372e3300
commit 801b04c057
4 changed files with 15 additions and 4 deletions

View File

@ -10,6 +10,11 @@ class zulip::app_frontend_base {
] ]
zulip::safepackage { $web_packages: ensure => 'installed' } zulip::safepackage { $web_packages: ensure => 'installed' }
$nagios_plugins = $::osfamily ? {
'debian' => 'nagios-plugins-basic',
'redhat' => 'nagios-plugins',
}
file { '/etc/nginx/zulip-include/app': file { '/etc/nginx/zulip-include/app':
require => Package['nginx-full'], require => Package['nginx-full'],
owner => 'root', owner => 'root',
@ -136,7 +141,7 @@ class zulip::app_frontend_base {
ensure => absent, ensure => absent,
} }
file { '/usr/lib/nagios/plugins/zulip_app_frontend': file { '/usr/lib/nagios/plugins/zulip_app_frontend':
require => Package[nagios-plugins-basic], require => Package[$nagios_plugins],
recurse => true, recurse => true,
purge => true, purge => true,
owner => 'root', owner => 'root',

View File

@ -33,6 +33,7 @@ class zulip::base {
# Needed for the cron jobs installed by puppet # Needed for the cron jobs installed by puppet
'cron', 'cron',
] ]
$nagios_plugins = 'nagios-plugins-basic'
} }
'redhat': { 'redhat': {
$release_name = "${::operatingsystem}${::operatingsystemmajrelease}" $release_name = "${::operatingsystem}${::operatingsystemmajrelease}"
@ -46,6 +47,7 @@ class zulip::base {
'nagios-plugins', # there is no dummy package on CentOS 7 'nagios-plugins', # there is no dummy package on CentOS 7
'cronie' 'cronie'
] ]
$nagios_plugins = 'nagios-plugins'
} }
default: { default: {
fail('osfamily not supported') fail('osfamily not supported')
@ -156,7 +158,7 @@ class zulip::base {
} }
file { '/usr/lib/nagios/plugins/zulip_base': file { '/usr/lib/nagios/plugins/zulip_base':
require => Package[nagios-plugins-basic], require => Package[$nagios_plugins],
recurse => true, recurse => true,
purge => true, purge => true,
owner => 'root', owner => 'root',

View File

@ -3,8 +3,12 @@
# #
# Depends on zulip::base to have installed `nagios-plugins-basic`. # Depends on zulip::base to have installed `nagios-plugins-basic`.
class zulip::nagios { class zulip::nagios {
$nagios_plugins = $::osfamily ? {
'debian' => 'nagios-plugins-basic',
'redhat' => 'nagios-plugins',
}
file { '/usr/lib/nagios/plugins/zulip_nagios_server': file { '/usr/lib/nagios/plugins/zulip_nagios_server':
require => Package[nagios-plugins-basic], require => Package[$nagios_plugins],
recurse => true, recurse => true,
purge => true, purge => true,
owner => 'root', owner => 'root',

View File

@ -39,7 +39,7 @@ class zulip::postgres_appdb_base {
source => 'puppet:///modules/zulip/postgresql/zulip_english.stop', source => 'puppet:///modules/zulip/postgresql/zulip_english.stop',
} }
file { '/usr/lib/nagios/plugins/zulip_postgres_appdb': file { '/usr/lib/nagios/plugins/zulip_postgres_appdb':
require => Package[nagios-plugins-basic], require => Package[$zulip::postgres_common::nagios_plugins],
recurse => true, recurse => true,
purge => true, purge => true,
owner => 'root', owner => 'root',