mirror of
https://github.com/zulip/zulip.git
synced 2026-07-09 21:21:47 +08:00
puppet: Swap the one use of the cron resource for an /etc/cron.d file.
The `cron` resource places its contents in the user's crontab, which makes it unlike every other cron job that Zulip installs. Switch to using `/etc/cron.d` files, like all other cron jobs.
This commit is contained in:
parent
90e1a0400e
commit
83091cbc96
3
puppet/zulip/files/cron.d/pg-backup-and-purge
Normal file
3
puppet/zulip/files/cron.d/pg-backup-and-purge
Normal file
@ -0,0 +1,3 @@
|
||||
PATH=/bin:/usr/bin:/usr/local/bin
|
||||
|
||||
0 2 * * * postgres /usr/local/bin/pg_backup_and_purge
|
||||
@ -43,15 +43,26 @@ class zulip::postgresql_backups {
|
||||
],
|
||||
}
|
||||
|
||||
# Zulip 4.x and before used the `cron` resource here, which placed
|
||||
# this in the postgres user's crontab, which was not discoverable.
|
||||
# Removed 2021-11 in version 5.0; these lines can be removed when we
|
||||
# drop support for upgrading from Zulip 4 or older.
|
||||
cron { 'pg_backup_and_purge':
|
||||
ensure => present,
|
||||
ensure => absent,
|
||||
command => '/usr/local/bin/pg_backup_and_purge',
|
||||
environment => 'PATH=/bin:/usr/bin:/usr/local/bin',
|
||||
hour => 2,
|
||||
minute => 0,
|
||||
target => 'postgres',
|
||||
user => 'postgres',
|
||||
require => File['/usr/local/bin/pg_backup_and_purge'],
|
||||
}
|
||||
file { '/etc/cron.d/pg_backup_and_purge':
|
||||
ensure => present,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0644',
|
||||
source => 'puppet:///modules/zulip/cron.d/pg-backup-and-purge',
|
||||
require => File['/usr/local/bin/pg_backup_and_purge'],
|
||||
}
|
||||
|
||||
file { "${zulip::common::nagios_plugins_dir}/zulip_postgresql_backups":
|
||||
|
||||
Loading…
Reference in New Issue
Block a user