ask: stream db backup

Despite be deprecated, the ask server is our 3rd biggest backup.  Even
though the site is R/O we're still backing up the fresh rotations of
the gzipped backups every day.

To reduce the incremental space requirements, move to our plain-text
streaming for the db backup.  This just needs a file dropped in /etc;
see the backup-borg role README documentation.  We do this in puppet
to avoid complexity adding this deprecated service to ansible.  This
then excludes the on-disk db backup dir.

Drop the bup backups while we are here.

Change-Id: Icfd81aca58b9a0dc3a3b74de04c1b00f03160327
This commit is contained in:
Ian Wienand 2021-02-05 12:16:18 +11:00
parent 0b86a6a82e
commit f9184ce323
2 changed files with 20 additions and 6 deletions

View File

@ -1,2 +1,5 @@
extra_users: extra_users:
- mkiss - mkiss
borg_backup_excludes:
# backed up via streaming
- /var/backups/pgsql_backups

View File

@ -103,6 +103,23 @@ class openstack_project::ask (
password => postgresql_password($db_user, $db_password), password => postgresql_password($db_user, $db_password),
} }
# Streaming backup of db; see borg-backup role
file { '/etc/borg-streams':
ensure => directory,
owner => 'root',
group => 'root',
mode => '0755',
}
file { '/etc/borg-streams/pgsql':
ensure => file,
owner => 'root',
group => 'root',
mode => '0755',
content => '/usr/bin/pg_dump -h localhost -U ask -p 5432 askbotdb',
require => File['/etc/borg-streams'],
}
# redis cache # redis cache
class { 'redis': class { 'redis':
redis_port => $redis_port, redis_port => $redis_port,
@ -171,12 +188,6 @@ class openstack_project::ask (
num_backups => '10', num_backups => '10',
} }
include bup
bup::site { 'ord.rax':
backup_user => 'bup-ask01',
backup_server => 'backup01.ord.rax.ci.openstack.org',
}
class { '::httpd::logrotate': class { '::httpd::logrotate':
options => [ options => [
'daily', 'daily',