Files
zulip/puppet/zulip_ops/manifests/postgres_common.pp
Greg Price 98cef0ab48 py3: Augment all mentions of system Python packages to include Python 3.
In some of these contexts, we may still be *using* the Python 2
version, but at least this should eliminate running into
`ImportError`s one by one in scripts that run outside a virtualenv,
as we update their shebangs to refer to Python 3.

Several Python libraries we use don't come in Python 3 versions on
trusty: gevent, boto, twisted, django, django-tagging, whisper.
The latter two don't come in Python 3 versions even on xenial.
So some work required before we can actually switch the code that
relies on those libraries to run as Python 3 -- probably the best
solution will be to backport them all in our apt repo.  (All but
`whisper` are packaged in zesty; `whisper` upstream just grew Python 3
support this year.)
2017-08-09 14:07:05 -07:00

46 lines
1.6 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",
# Postgres Nagios check plugin
"check-postgres",
]
package { $internal_postgres_packages: ensure => "installed" }
exec {"pip_wal-e":
command => "/usr/bin/pip install git+git://github.com/zbenjamin/wal-e.git#egg=wal-e",
creates => "/usr/local/bin/wal-e",
require => Package['python3-pip',
# 'python3-boto', 'python3-gevent', # missing on trusty
'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,
}
}