1
0
Fork 0
mirror of https://gitlab.com/s3lph/ansible-collection-dirvish synced 2024-12-04 23:21:03 +01:00

Add support for dirvish-expire

This commit is contained in:
s3lph 2021-08-18 01:27:42 +02:00
parent 373a1bcd16
commit afe44fb1ab
4 changed files with 17 additions and 1 deletions

View file

@ -6,6 +6,15 @@
dirvish_client_snapshot_scripts:
- mysql-snapshot.sh
# Advanced backup retention rule
dirvish_server_expire_rules:
# Keep first backup of the month for 6 months
- "* * 1 * * +6 months"
# Keep first backup of every quarter for 3 years
- "* * 1 1,4,7,10 * +3 years"
# Keep first backup of a year forever
- "* * 1 1 * never"
# Exclude the MariaDB data directory, as that's already covered by the snapshot
dirvish_server_client_exclude:
- 'var/lib/mysql/'

View file

@ -7,7 +7,7 @@ namespace: s3lph
name: dirvish
# The version of the collection. Must be compatible with semantic versioning
version: 0.5.0
version: 0.6.0
# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
readme: README.md

View file

@ -18,6 +18,7 @@ dirvish_server_image_name: "%Y%m%d-%H%M%S"
dirvish_server_log_compression: gzip
dirvish_server_index_compression: gzip
dirvish_server_expire_default: "+31 days"
dirvish_server_expire_rules: []
dirvish_server_exclude:
- lost+found/

View file

@ -9,6 +9,12 @@ tree: /
{% if item != inventory_hostname %}
rsh: {{ hostvars[item].dirvish_server_client_rsh | default(dirvish_server_rsh) }}
{% endif %}
{% if hostvars[item].dirvish_server_expire_rules is defined and hostvars[item].dirvish_server_expire_rules | length > 0 %}
expire-rule:
{% for rule in hostvars[item].dirvish_server_expire_rules %}
{{ rule }}
{% endfor %}
{% endif%}
{% if hostvars[item].dirvish_server_client_exclude is defined and hostvars[item].dirvish_server_client_exclude | length > 0 %}
exclude: