From 2509e35998555c19adeb7ce6d57aa681f232dca8 Mon Sep 17 00:00:00 2001 From: "Daniel A. Maierhofer" Date: Sat, 23 Feb 2019 00:39:44 +0100 Subject: [PATCH] Add fsdr backup on fsdrnas --- doc/fsdrnas.yml | 20 ++++++++++++++++++++ host_vars/fsdr | 47 +++++++++++++++++++++++++++++++++++++++++++++++ host_vars/fsdrnas | 7 +++++++ hosts/production | 2 ++ roles/common | 2 +- site.yml | 8 ++++++++ 6 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 doc/fsdrnas.yml create mode 100644 host_vars/fsdr create mode 100644 host_vars/fsdrnas diff --git a/doc/fsdrnas.yml b/doc/fsdrnas.yml new file mode 100644 index 0000000..437706c --- /dev/null +++ b/doc/fsdrnas.yml @@ -0,0 +1,20 @@ +# fsdrnas +## Enable SSH and prohibit-password +```shell +xbps-install -Su +vim /etc/ssh/sshd_config +ln -s /etc/sv/sshd/ /var/service/ +``` +# Create RAID +```shell +xbps-install mdadm +mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sda2 /dev/sdb2 +mkfs.btrfs -f /dev/md0 +cat /proc/mdstat +``` +## Check disks +```shell +xbps-install smartmontools +smartctl -a /dev/sda +smartctl -a /dev/sdb +``` diff --git a/host_vars/fsdr b/host_vars/fsdr new file mode 100644 index 0000000..62cd986 --- /dev/null +++ b/host_vars/fsdr @@ -0,0 +1,47 @@ +inventory_hostname: fsdr.htu.tuwien.ac.at +inventory_hostname_short: fsdr + +borgbackup_install_from_repo: False + +borgbackup_encryption_mode: "none" + +borgbackup_client_backup_server: fsdrnas + +borgbackup_create_jobs: + - name: system + options: "--lock-wait 7200" + day: "*" + hour: 0 # default value = 1 + minute: 0 # default value = 0 + random_hour: 5 # default value : ignore randomization + random_minute: 59 # default value : ignore randomization + directories: + - "/srv" + - "/etc" + - "/home" + - "/root" + - "/var/lib/mailman" + - "/var/www" + - "/var/lib/automysqlbackup/daily/" + excludes: [] + +borgbackup_prune_enabled: yes +borgbackup_prune_jobs: + - name: system + prune_options: "--lock-wait 7200 --keep-daily=7 --keep-weekly=4 --keep-monthly=12 --keep-yearly=-1" + day: "*" + hour: 12 # default value = 1 + minute: 0 # default value = 0 + random_hour: 5 # default value : ignore randomization + random_minute: 59 # default value : ignore randomization + +borgbackup_check_enabled: yes +borgbackup_check_jobs: + - name: system + check_options: "--lock-wait 28800" + day: 1 + hour: 12 # default value = 1 + minute: 0 # default value = 0 + random_hour: 5 # default value : ignore randomization + random_minute: 59 # default value : ignore randomization + random_day: 27 # default value : ignore randomization diff --git a/host_vars/fsdrnas b/host_vars/fsdrnas new file mode 100644 index 0000000..9ab5a11 --- /dev/null +++ b/host_vars/fsdrnas @@ -0,0 +1,7 @@ +inventory_hostname: fsdrnas.htu.tuwien.ac.at +inventory_hostname_short: fsdrnas + +borgbackup_install_from_repo: True +borgbackup_binary: "/usr/bin/borg" + +borgbackup_encryption_mode: "none" diff --git a/hosts/production b/hosts/production index ca8a41c..50c25ef 100644 --- a/hosts/production +++ b/hosts/production @@ -13,12 +13,14 @@ all: zyklon: laika: progress: + fsdrnas: fet_qemu: hosts: maria-storage: buran: nauka: ruby: + fsdr: fet_pi: hosts: baroness: diff --git a/roles/common b/roles/common index 8f3aff1..3ae3c5e 160000 --- a/roles/common +++ b/roles/common @@ -1 +1 @@ -Subproject commit 8f3aff10dab28b2a4b7fd02b112242dd872293ee +Subproject commit 3ae3c5ee50d70d30ff8892ce50c3f1bee32d0249 diff --git a/site.yml b/site.yml index b837a67..999f914 100644 --- a/site.yml +++ b/site.yml @@ -64,6 +64,14 @@ roles: - borg_client +- hosts: fsdr + roles: + - borg_client + +- hosts: fsdrnas + roles: + - borg_server + - hosts: progress roles: - scans