system-config/playbooks
Ian Wienand 028d655375 Add borg-backup roles
This adds roles to implement backup with borg [1].

Our current tool "bup" has no Python 3 support and is not packaged for
Ubuntu Focal.  This means it is effectively end-of-life.  borg fits
our model of servers backing themselves up to a central location, is
well documented and seems well supported.  It also has the clarkb seal
of approval :)

As mentioned, borg works in the same manner as bup by doing an
efficient back up over ssh to a remote server.  The core of these
roles are the same as the bup based ones; in terms of creating a
separate user for each host and deploying keys and ssh config.

This chooses to install borg in a virtualenv on /opt.  This was chosen
for a number of reasons; firstly reading the history of borg there
have been incompatible updates (although they provide a tool to update
repository formats); it seems important that we both pin the version
we are using and keep clients and server in sync.  Since we have a
hetrogenous distribution collection we don't want to rely on the
packaged tools which may differ.  I don't feel like this is a great
application for a container; we actually don't want it that isolated
from the base system because it's goal is to read and copy it offsite
with as little chance of things going wrong as possible.

Borg has a lot of support for encrypting the data at rest in various
ways.  However, that introduces the possibility we could lose both the
key and the backup data.  Really the only thing stopping this is key
management, and if we want to go down this path we can do it as a
follow-on.

The remote end server is configured via ssh command rules to run in
append-only mode.  This means a misbehaving client can't delete its
old backups.  In theory we can prune backups on the server side --
something we could not do with bup.  The documentation has been
updated but is vague on this part; I think we should get some hosts in
operation, see how the de-duplication is working out and then decide
how we want to mange things long term.

Testing is added; a focal and bionic host both run a full backup of
themselves to the backup server.  Pretty cool, the logs are in
/var/log/borg-backup-<host>.log.

No hosts are currently in the borg groups, so this can be applied
without affecting production.  I'd suggest the next steps are to bring
up a borg-based backup server and put a few hosts into this.  After
running for a while, we can add all hosts, and then deprecate the
current bup-based backup server in vexxhost and replace that with a
borg-based one; giving us dual offsite backups.

[1] https://borgbackup.readthedocs.io/en/stable/

Change-Id: I2a125f2fac11d8e3a3279eb7fa7adb33a3acaa4e
2020-07-21 17:36:50 +10:00
..
filter_plugins dns_[a|aaaa] filter; use host for lookup 2018-09-13 22:50:40 +10:00
group_vars Split inventory into multiple dirs and move hostvars 2020-06-04 07:44:36 -05:00
k8s Add resources for deploying rook and xtradb to kuberenets 2019-02-05 18:52:21 +00:00
module_utils/facts/system Ensure apt is used on ubuntu hosts with zypper 2018-08-20 20:45:13 +00:00
periodic Remove old 404 checker job 2020-03-11 15:15:00 -07:00
roles Add borg-backup roles 2020-07-21 17:36:50 +10:00
templates/clouds Remove linaro-london cloud 2020-05-16 10:14:09 +10:00
zuul Add borg-backup roles 2020-07-21 17:36:50 +10:00
apply-package-updates.yaml Apply package updates before we reboot in launch-node 2019-02-26 14:17:23 -08:00
base.yaml Run iptables in service playbooks instead of base 2020-06-04 07:44:22 -05:00
bootstrap-k8s-nodes.yaml Stop running k8s-on-openstack nested 2019-02-12 18:17:46 +00:00
gitea-rename-setup-org.yaml Restore setup-org.yaml 2019-09-18 12:40:19 -07:00
gitea-rename-tasks.yaml Restore setup-org.yaml 2019-09-18 12:40:19 -07:00
install_puppet.yaml Handle moved puppet repos 2019-05-15 16:03:07 -07:00
install-ansible.yaml Update to Ansible 2.9.8 2020-05-13 05:32:54 +10:00
letsencrypt.yaml Rename service-letsencrypt to just letsencrypt 2020-06-04 07:44:36 -05:00
manage-projects.yaml Stop running manage projects on review-test 2020-06-26 11:07:10 -05:00
nodepool_restart.yaml Add stop and start playbooks for nodepool 2020-06-16 15:48:47 -05:00
nodepool_start.yaml Add stop and start playbooks for nodepool 2020-06-16 15:48:47 -05:00
nodepool_stop.yaml Add stop and start playbooks for nodepool 2020-06-16 15:48:47 -05:00
remote_puppet_adhoc.yaml Clean up puppet variables and playbooks 2018-08-17 09:41:12 -05:00
remote_puppet_afs.yaml Use zuul checkouts of ansible roles from other repos 2020-04-30 12:39:12 -05:00
remote_puppet_else.yaml Use zuul checkouts of ansible roles from other repos 2020-04-30 12:39:12 -05:00
rename_repos.yaml Fix rename playbook after zuul user rename 2020-06-12 14:21:33 -07:00
run_cloud_launcher.yaml Use zuul checkouts of ansible roles from other repos 2020-04-30 12:39:12 -05:00
run-accessbot.yaml Split eavesdrop into its own playbook 2020-04-23 14:34:28 -05:00
service-backup.yaml Run iptables in service playbooks instead of base 2020-06-04 07:44:22 -05:00
service-borg-backup.yaml Add borg-backup roles 2020-07-21 17:36:50 +10:00
service-bridge.yaml Add tool to export Rackspace DNS domains to bind format 2020-06-12 16:49:23 +10:00
service-codesearch.yaml Install pip3 on codesearch 2020-06-15 14:35:41 -05:00
service-eavesdrop.yaml Run iptables in service playbooks instead of base 2020-06-04 07:44:22 -05:00
service-etherpad.yaml Run iptables in service playbooks instead of base 2020-06-04 07:44:22 -05:00
service-gitea-lb.yaml Run iptables in service playbooks instead of base 2020-06-04 07:44:22 -05:00
service-gitea.yaml Run iptables in service playbooks instead of base 2020-06-04 07:44:22 -05:00
service-grafana.yaml Grafana container deployment 2020-07-03 07:17:22 +10:00
service-graphite.yaml Graphite container deployment 2020-07-03 07:17:28 +10:00
service-meetpad.yaml Run iptables in service playbooks instead of base 2020-06-04 07:44:22 -05:00
service-mirror-update.yaml Run iptables in service playbooks instead of base 2020-06-04 07:44:22 -05:00
service-mirror.yaml Run iptables in service playbooks instead of base 2020-06-04 07:44:22 -05:00
service-nameserver.yaml Run iptables in service playbooks instead of base 2020-06-04 07:44:22 -05:00
service-nodepool.yaml Run iptables in service playbooks instead of base 2020-06-04 07:44:22 -05:00
service-registry.yaml Run iptables in service playbooks instead of base 2020-06-04 07:44:22 -05:00
service-review-dev.yaml Run iptables in service playbooks instead of base 2020-06-04 07:44:22 -05:00
service-review.yaml Run iptables in service playbooks instead of base 2020-06-04 07:44:22 -05:00
service-static.yaml Run iptables in service playbooks instead of base 2020-06-04 07:44:22 -05:00
service-zookeeper.yaml Run iptables in service playbooks instead of base 2020-06-04 07:44:22 -05:00
service-zuul-preview.yaml Run iptables in service playbooks instead of base 2020-06-04 07:44:22 -05:00
service-zuul.yaml Run iptables in service playbooks instead of base 2020-06-04 07:44:22 -05:00
set-hostnames.yaml Split eavesdrop into its own playbook 2020-04-23 14:34:28 -05:00
start-mergers-executors.yaml Rework zuul start/stop/restart playbooks for docker 2020-04-27 09:34:50 -05:00
stop-mergers-executors.yaml Rework zuul start/stop/restart playbooks for docker 2020-04-27 09:34:50 -05:00
sync-gitea-projects.yaml Fix URLs after OpenDev rename 2020-03-18 18:23:17 +01:00
sync-to-review-test.yaml Add playbook for syncing state from review to review-test 2020-06-15 13:32:05 -05:00
test-gitea.yaml Run actual full project creation in gitea test 2019-07-11 13:39:22 -07:00
unattended_upgrades.yml Rename attended_upgrades playbook to unattended_upgrades 2016-07-19 10:41:09 +02:00
update_puppet_version.yaml Fix URLs after OpenDev rename 2020-03-18 18:23:17 +01:00
zuul_reconfigure.yaml Stub out zuul_reconfigure playbook 2018-09-14 09:17:36 -06:00
zuul_restart.yaml Rework zuul start/stop/restart playbooks for docker 2020-04-27 09:34:50 -05:00
zuul_start.yaml Rework zuul start/stop/restart playbooks for docker 2020-04-27 09:34:50 -05:00
zuul_stop.yaml Rework zuul start/stop/restart playbooks for docker 2020-04-27 09:34:50 -05:00