All hosts are now running thier backups via borg to servers in vexxhost and rax.ord. For reference, the servers being backed up at this time are: borg-ask01 borg-ethercalc02 borg-etherpad01 borg-gitea01 borg-lists borg-review-dev01 borg-review01 borg-storyboard01 borg-translate01 borg-wiki-update-test borg-zuul01 This removes the old bup backup hosts, the no-longer used ansible roles for the bup backup server and client roles, and any remaining bup related configuration. For simplicity, we will remove any remaining bup cron jobs on the above servers manually after this merges. Change-Id: I32554ca857a81ae8a250ce082421a7ede460ea3cchanges/30/766630/3
parent
ebdd2144bf
commit
39ffc685d6
@ -1,7 +0,0 @@
|
||||
# == Class: openstack_project::backup_server
|
||||
#
|
||||
class openstack_project::backup_server {
|
||||
package { 'bup':
|
||||
ensure => present,
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
Setup backup server
|
||||
|
||||
This role configures backup server(s) in the ``backup-server`` group
|
||||
to accept backups from remote hosts.
|
||||
|
||||
Note that the ``backup`` role must have run on each host in the
|
||||
``backup`` group before this role. That role will create a
|
||||
``bup_user`` tuple in the hostvars for for each host consisting of the
|
||||
required username and public key.
|
||||
|
||||
Each required user gets a separate home directory in ``/opt/backups``.
|
||||
Their ``authorized_keys`` file is configured with the public key to
|
||||
allow the remote host to log in and only run ``bup``.
|
||||
|
||||
**Role Variables**
|
@ -1 +0,0 @@
|
||||
bup_users: []
|
@ -1,21 +0,0 @@
|
||||
- name: Create backup directory
|
||||
file:
|
||||
state: directory
|
||||
path: /opt/backups
|
||||
|
||||
- name: Install bup
|
||||
package:
|
||||
name:
|
||||
- bup
|
||||
state: present
|
||||
|
||||
- name: Build all bup users from backup hosts
|
||||
set_fact:
|
||||
bup_users: '{{ bup_users }} + [ {{ hostvars[item]["bup_user"] }} ]'
|
||||
with_inventory_hostnames: 'backup:!disabled'
|
||||
|
||||
- name: Create bup users
|
||||
include_tasks: user.yaml
|
||||
loop: '{{ bup_users }}'
|
||||
loop_control:
|
||||
loop_var: bup_user
|
@ -1,32 +0,0 @@
|
||||
# note bup_user is the parent loop variable name; this works on each
|
||||
# element from the bup_users global.
|
||||
- name: Set variables
|
||||
set_fact:
|
||||
user_name: '{{ bup_user[0] }}'
|
||||
user_key: '{{ bup_user[1] }}'
|
||||
|
||||
- name: Create bup user
|
||||
user:
|
||||
name: '{{ user_name }}'
|
||||
comment: 'Backup user'
|
||||
shell: /bin/bash
|
||||
home: '/opt/backups/{{ user_name }}'
|
||||
create_home: yes
|
||||
register: homedir
|
||||
|
||||
- name: Create bup user authorized key
|
||||
authorized_key:
|
||||
user: '{{ user_name }}'
|
||||
state: present
|
||||
key: '{{ user_key }}'
|
||||
key_options: 'command="BUP_DEBUG=0 BUP_FORCE_TTY=3 bup server",no-port-forwarding,no-agent-forwarding,no-X11-forwarding,no-pty'
|
||||
|
||||
# ansible-lint wants this in a handler, it should be done here and
|
||||
# now; this isn't like a service restart where multiple things might
|
||||
# call it.
|
||||
- name: Initalise bup
|
||||
shell: |
|
||||
BUP_DIR=/opt/backups/{{ user_name }}/.bup bup init
|
||||
become: yes
|
||||
become_user: '{{ user_name }}'
|
||||
when: homedir.changed
|
@ -1,23 +0,0 @@
|
||||
Configure a host to be backed up
|
||||
|
||||
This role setups a host to use ``bup`` for backup to any hosts in the
|
||||
``backup-server`` group.
|
||||
|
||||
A separate ssh key will be generated for root to connect to the backup
|
||||
server(s) and the host key for the backup servers will be accepted to
|
||||
the host.
|
||||
|
||||
The ``bup`` tool is installed and a cron job is setup to run the
|
||||
backup periodically.
|
||||
|
||||
Note the ``backup-server`` role must run after this to create the user
|
||||
correctly on the backup server. This role sets a tuple ``bup_user``
|
||||
with the username and public key; the ``backup-server`` role uses this
|
||||
variable for each host in the ``backup`` group to initalise users.
|
||||
|
||||
**Role Variables**
|
||||
|
||||
.. zuul:rolevar:: bup_username
|
||||
|
||||
The username to connect to the backup server. If this is left
|
||||
undefined, it will be automatically set to ``bup-$(hostname)``
|
@ -1,25 +0,0 @@
|
||||
/proc/*
|
||||
/sys/*
|
||||
/dev/*
|
||||
/tmp/*
|
||||
/floppy/*
|
||||
/cdrom/*
|
||||
/var/spool/squid/*
|
||||
/var/spool/exim/*
|
||||
/media/*
|
||||
/mnt/*
|
||||
/var/agentx/*
|
||||
/run/*
|
||||
/root/backup-restore-*
|
||||
/root/.bup
|
||||
/etc/puppet/modules/*
|
||||
/etc/puppet/hieradata/*
|
||||
/var/cache/*
|
||||
/var/lib/docker/*
|
||||
/var/lib/puppet/reports/*
|
||||
/var/lib/postgresql/*
|
||||
/var/lib/lxcfs/*
|
||||
/var/lib/zuul/backup/*
|
||||
/var/lib/zuul/times/*
|
||||
/opt/system-config/*
|
||||
/afs/*
|
@ -1,57 +0,0 @@
|
||||
- name: Generate bup username for this host
|
||||
set_fact:
|
||||
bup_username: 'bup-{{ inventory_hostname.split(".", 1)[0] }}'
|
||||
when: bup_username is not defined
|
||||
|
||||
- debug:
|
||||
var: bup_username
|
||||
|
||||
- name: Install bup
|
||||
package:
|
||||
name:
|
||||
- bup
|
||||
state: absent
|
||||
|
||||
- name: Remove old keypair
|
||||
file:
|
||||
path: /root/.ssh/id_backup_ed25519
|
||||
state: absent
|
||||
|
||||
- name: Remove old keypair
|
||||
file:
|
||||
path: /root/.ssh/id_backup_ed25519.pub
|
||||
state: absent
|
||||
|
||||
- name: Remove old config directory
|
||||
file:
|
||||
path: /root/.bup
|
||||
state: absent
|
||||
|
||||
- name: Remove ssh config
|
||||
blockinfile:
|
||||
path: /root/.ssh/config
|
||||
state: absent
|
||||
create: false
|
||||
block: |
|
||||
Host {{ item }}
|
||||
HostName {{ item }}
|
||||
IdentityFile /root/.ssh/id_backup_ed25519
|
||||
User {{ bup_username }}
|
||||
mode: 0600
|
||||
with_inventory_hostnames: backup-server
|
||||
ignore_errors: True
|
||||
|
||||
- name: Remove /etc/bup-excludes
|
||||
file:
|
||||
path: /etc/bup-excludes
|
||||
state: absent
|
||||
|
||||
- name: Remove backup cronjob
|
||||
cron:
|
||||
name: "Run bup backup"
|
||||
job: "tar -X /etc/bup-excludes -cPF - / | bup split -r {{ bup_username }}@{{ item }}: -n root -q"
|
||||
user: root
|
||||
hour: '5'
|
||||
minute: '{{ 59|random(seed=item) }}'
|
||||
state: absent
|
||||
with_inventory_hostnames: backup-server
|
@ -1,8 +0,0 @@
|
||||
# NOTE(ianw) : we are removing bup for borg. This just needs to run
|
||||
# once to remove bup parts from the backup clients, then we will
|
||||
# remove it completely.
|
||||
- hosts: "backup:!disabled"
|
||||
name: "Base: Generate backup users and keys"
|
||||
roles:
|
||||
- iptables
|
||||
- backup
|
@ -1 +0,0 @@
|
||||
bup_username: bup-backup01
|
@ -1,2 +0,0 @@
|
||||
# Intentionally left blank to test autogeneration of name
|
||||
#bup_username: bup-backup-test02
|
Loading…
Reference in new issue