Files
zulip/puppet/zulip_ops/manifests/postgres_common.pp
Greg Price e4d1d22e9f py3: Explicitly keep our wal-e PostgreSQL replication on Python 2.
On `trusty` there is no package for `boto` or `gevent` on Python 3, both
of which are dependencies of `wal-e` (at the version we've pinned.)  This
is something used only on database servers and only in a replication
scenario, and it doesn't involve any of our code outside the wal-e repo,
so the Python version it uses is quite independent of the Zulip
application server itself and the rest of our code.  For now, keep it
explicitly on Python 2 while we move forward for most everything else.
2017-08-15 17:30:31 -07:00

48 lines
1.7 KiB
Puppet

class zulip_ops::postgres_common {
include zulip::postgres_common
$internal_postgres_packages = [# dependencies for our wal-e backup system
"lzop",
"pv",
"python3-pip",
"python-pip",
# "python3-gevent", # missing on trusty
"python-gevent",
# Postgres Nagios check plugin
"check-postgres",
]
package { $internal_postgres_packages: ensure => "installed" }
exec {"pip_wal-e":
# On trusty, there is no python3-boto or python3-gevent package,
# so we keep our `wal-e` explicitly on Python 2 for now.
command => "/usr/bin/pip2 install git+git://github.com/zbenjamin/wal-e.git#egg=wal-e",
creates => "/usr/local/bin/wal-e",
require => Package['python-pip', 'python-boto', 'python-gevent',
'lzop', 'pv'],
}
cron { "pg_backup_and_purge":
command => "/usr/local/bin/pg_backup_and_purge.py",
ensure => present,
environment => "PATH=/bin:/usr/bin:/usr/local/bin",
hour => 5,
minute => 0,
target => "postgres",
user => "postgres",
require => [ File["/usr/local/bin/pg_backup_and_purge.py"],
Package["postgresql-${zulip::base::postgres_version}",
"python3-dateutil",
"python-dateutil"
] ]
}
exec { "sysctl_p":
command => "/sbin/sysctl -p /etc/sysctl.d/40-postgresql.conf",
subscribe => File['/etc/sysctl.d/40-postgresql.conf'],
refreshonly => true,
}
}