mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
puppet: Add CentOS packages to postgres_common.pp.
This commit is contained in:
@@ -1,9 +1,11 @@
|
|||||||
class zulip::postgres_common {
|
class zulip::postgres_common {
|
||||||
case $::osfamily {
|
case $::osfamily {
|
||||||
'debian': {
|
'debian': {
|
||||||
|
$nagios_plugins = 'nagios-plugins-basic'
|
||||||
|
$postgresql = "postgresql-${zulip::base::postgres_version}"
|
||||||
$postgres_packages = [
|
$postgres_packages = [
|
||||||
# The database itself
|
# The database itself
|
||||||
"postgresql-${zulip::base::postgres_version}",
|
$postgresql,
|
||||||
# tools for database monitoring
|
# tools for database monitoring
|
||||||
'ptop',
|
'ptop',
|
||||||
# Needed just to support adding postgres user to 'zulip' group
|
# Needed just to support adding postgres user to 'zulip' group
|
||||||
@@ -20,38 +22,47 @@ class zulip::postgres_common {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
'redhat': {
|
'redhat': {
|
||||||
|
$nagios_plugins = 'nagios-plugins'
|
||||||
|
$postgresql = "postgresql${zulip::base::postgres_version}"
|
||||||
$postgres_packages = [
|
$postgres_packages = [
|
||||||
# The database itself
|
$postgresql,
|
||||||
"postgresql-${zulip::base::postgres_version}",
|
"${postgresql}-server",
|
||||||
# tools for database monitoring
|
"${postgresql}-devel",
|
||||||
'ptop',
|
'pg_top',
|
||||||
# Needed just to support adding postgres user to 'zulip' group
|
'ssl-cert', #?? TODO no equivalent on CentOS 7
|
||||||
'ssl-cert',
|
'hunspell-en-US',
|
||||||
# our dictionary
|
# exists on CentOS 6 and Fedora 29 but not CentOS 7
|
||||||
'hunspell-en-us',
|
# see https://pkgs.org/download/check_postgres
|
||||||
# Postgres Nagios check plugin
|
# alternatively, download directly from:
|
||||||
'check-postgres',
|
# https://bucardo.org/check_postgres/
|
||||||
|
# 'check-postgres', # TODO
|
||||||
]
|
]
|
||||||
exec {'pip2_deps':
|
exec {'pip2_deps':
|
||||||
# Python modules used in our monitoring/worker threads
|
# Python modules used in our monitoring/worker threads
|
||||||
command => '/usr/bin/pip2 install pytz python-dateutil'
|
command => '/usr/bin/pip2 install pytz python-dateutil'
|
||||||
}
|
}
|
||||||
|
|
||||||
exec {'pip3_deps':
|
exec {'pip3_deps':
|
||||||
command => 'python3 -m pip install pytz python-dateutil'
|
command => 'python3 -m pip install pytz python-dateutil'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
default: {
|
||||||
|
fail('osfamily not supported')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
zulip::safepackage { $postgres_packages: ensure => 'installed' }
|
zulip::safepackage { $postgres_packages: ensure => 'installed' }
|
||||||
|
|
||||||
exec { 'disable_logrotate':
|
if $::osfamily == 'debian' {
|
||||||
# lint:ignore:140chars
|
# The logrotate file only created in debian-based systems
|
||||||
command => '/usr/bin/dpkg-divert --rename --divert /etc/logrotate.d/postgresql-common.disabled --add /etc/logrotate.d/postgresql-common',
|
exec { 'disable_logrotate':
|
||||||
# lint:endignore
|
# lint:ignore:140chars
|
||||||
creates => '/etc/logrotate.d/postgresql-common.disabled',
|
command => '/usr/bin/dpkg-divert --rename --divert /etc/logrotate.d/postgresql-common.disabled --add /etc/logrotate.d/postgresql-common',
|
||||||
|
# lint:endignore
|
||||||
|
creates => '/etc/logrotate.d/postgresql-common.disabled',
|
||||||
|
}
|
||||||
}
|
}
|
||||||
file { '/usr/lib/nagios/plugins/zulip_postgres_common':
|
file { '/usr/lib/nagios/plugins/zulip_postgres_common':
|
||||||
require => Package[nagios-plugins-basic],
|
require => Package[$nagios_plugins],
|
||||||
recurse => true,
|
recurse => true,
|
||||||
purge => true,
|
purge => true,
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
@@ -66,7 +77,7 @@ class zulip::postgres_common {
|
|||||||
group => 'postgres',
|
group => 'postgres',
|
||||||
mode => '0750',
|
mode => '0750',
|
||||||
source => 'puppet:///modules/zulip/postgresql/env-wal-e',
|
source => 'puppet:///modules/zulip/postgresql/env-wal-e',
|
||||||
require => Package["postgresql-${zulip::base::postgres_version}"],
|
require => Package[$postgresql],
|
||||||
}
|
}
|
||||||
|
|
||||||
file { '/usr/local/bin/pg_backup_and_purge':
|
file { '/usr/local/bin/pg_backup_and_purge':
|
||||||
@@ -83,7 +94,7 @@ class zulip::postgres_common {
|
|||||||
groups => ['ssl-cert'],
|
groups => ['ssl-cert'],
|
||||||
membership => minimum,
|
membership => minimum,
|
||||||
require => [
|
require => [
|
||||||
Package["postgresql-${zulip::base::postgres_version}"],
|
Package[$postgresql],
|
||||||
Package['ssl-cert']
|
Package['ssl-cert']
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user