From f9184ce32306d9035810965f0f62dd2073a253d4 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Fri, 5 Feb 2021 12:16:18 +1100 Subject: [PATCH] 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 --- inventory/service/group_vars/ask.yaml | 3 +++ modules/openstack_project/manifests/ask.pp | 23 ++++++++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/inventory/service/group_vars/ask.yaml b/inventory/service/group_vars/ask.yaml index 361f549c5a..6fe9056429 100644 --- a/inventory/service/group_vars/ask.yaml +++ b/inventory/service/group_vars/ask.yaml @@ -1,2 +1,5 @@ extra_users: - mkiss +borg_backup_excludes: + # backed up via streaming + - /var/backups/pgsql_backups diff --git a/modules/openstack_project/manifests/ask.pp b/modules/openstack_project/manifests/ask.pp index 2bdca07478..41710ede50 100644 --- a/modules/openstack_project/manifests/ask.pp +++ b/modules/openstack_project/manifests/ask.pp @@ -103,6 +103,23 @@ class openstack_project::ask ( 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 class { 'redis': redis_port => $redis_port, @@ -171,12 +188,6 @@ class openstack_project::ask ( num_backups => '10', } - include bup - bup::site { 'ord.rax': - backup_user => 'bup-ask01', - backup_server => 'backup01.ord.rax.ci.openstack.org', - } - class { '::httpd::logrotate': options => [ 'daily',