[borgbackup_client] precedence rules and sain defaults for borg config

This commit is contained in:
otthorn 2021-03-14 22:02:34 +01:00
parent 59f2c94a61
commit 7480a7c565
8 changed files with 32 additions and 12 deletions

View file

@ -1,7 +1,7 @@
#!/usr/bin/env ansible-playbook #!/usr/bin/env ansible-playbook
--- ---
# Install and configure bdd servers at Saclay and at OVH # Install and configure bdd servers at Saclay and at OVH
- hosts: bdd - hosts: bdd,!re2o-bdd.adm.auro.re,!services-bdd-local.adm.auro.re
roles: roles:
- postgresql_server - postgresql_server
... ...

3
group_vars/bdd.yml Normal file
View file

@ -0,0 +1,3 @@
---
borg_keep_hourly: 6
...

View file

@ -0,0 +1,8 @@
postgresql:
version: 13
hosts: # dbname, username, CIDR ip addr, auth method
- [ "nextcloud", "nextcloud", "10.128.0.58", "md5" ]
- [ "gitea", "gitea", "10.128.0.60", "md5" ]
- [ "drone", "drone", "10.128.0.64", "md5" ]
- [ "wikijs", "wikijs", "10.128.0.66", "md5" ]
- [ "vote", "vote", "10.128.0.81", "md5" ]

View file

@ -5,6 +5,7 @@ borg_keep_weekly: 4
borg_keep_monthly: 12 borg_keep_monthly: 12
borg_backup_directories: borg_backup_directories:
- "/etc/" - "/etc/"
- "/var"/
- "/data_nextcloud" - "/data_nextcloud"
- "/data_gitea" - "/data_gitea"
- "/data_mail" - "/data_mail"

View file

@ -1,8 +1,4 @@
--- ---
borg_keep_hourly: 0
borg_keep_daily: 7
borg_keep_weekly: 4
borg_keep_monthly: 12
borg_backup_directories: borg_backup_directories:
- "/etc/" - "/etc/"
- "/var/" - "/var/"

4
hosts
View file

@ -29,7 +29,6 @@ stream.adm.auro.re
re2o-server.adm.auro.re re2o-server.adm.auro.re
re2o-ldap.adm.auro.re re2o-ldap.adm.auro.re
re2o-db.adm.auro.re re2o-db.adm.auro.re
#services-bdd-local.adm.auro.re
backup.adm.auro.re backup.adm.auro.re
mail.adm.auro.re mail.adm.auro.re
wikijs.adm.auro.re wikijs.adm.auro.re
@ -39,6 +38,7 @@ jitsi-aurore.adm.auro.re
bdd.adm.auro.re bdd.adm.auro.re
bdd-ovh.adm.auro.re bdd-ovh.adm.auro.re
litl.adm.auro.re litl.adm.auro.re
services-bdd-local.adm.auro.re
[aurore_testing_vm] [aurore_testing_vm]
pendragon.adm.auro.re pendragon.adm.auro.re
@ -514,3 +514,5 @@ proxy.adm.auro.re
[bdd] [bdd]
bdd.adm.auro.re bdd.adm.auro.re
bdd-ovh.adm.auro.re bdd-ovh.adm.auro.re
services-bdd-local.adm.auro.re
re2o-bdd.adm.auro.re

View file

@ -1,7 +1,8 @@
--- ---
borg_keep_daily: 7 borg_keep_hourly: 0
borg_keep_weekly: 4 borg_keep_daily: 0
borg_keep_monthly: 12 borg_keep_weekly: 0
borg_keep_monthly: 0
borg_server_user: borgbackup borg_server_user: borgbackup
borg_server_group: borgbackup borg_server_group: borgbackup
... ...

View file

@ -23,9 +23,18 @@ storage:
retention: retention:
keep_daily: {{ borg_keep_daily }} {% if borg_keep_hourly > 0 %}
keep_weekly: {{ borg_keep_weekly }} - keep_hourly: {{ borg_keep_hourly }}
keep_monthly: {{ borg_keep_monthly }} {% endif %}
{% if borg_keep_daily > 0 %}
- keep_hourly: {{ borg_keep_daily }}
{% endif %}
{% if borg_keep_weekly > 0 %}
- keep_hourly: {{ borg_keep_weekly }}
{% endif %}
{% if borg_keep_monthly > 0 %}
- keep_hourly: {{ borg_keep_monthly }}
{% endif %}
consistency: consistency:
checks: checks: