-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdefaults.jinja
90 lines (66 loc) · 2.49 KB
/
defaults.jinja
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
{% import_yaml "backup/external.yml" as backup_external %}
{% set default_test_repository= '/opt/backup-test' %}
{% load_yaml as defaults %}
enabled: true
# backup run user
user: ""
# readall_privilege = true turns on: CAP_DAC_READ_SEARCH for user
readall_privilege: false
# backup target and secret key
repository_url: {{ default_test_repository }}
repository_key:
# extra env for backup call and hooks
env: {}
# if repository_url.startswith('sftp'): repository_ssh_id for ssh connection
ssh_id: ""
ssh_id_pub: ""
basedir: /
# include the following files/dirs
includes: []
# exclude some files/dirs inside this directories
excludes: []
steps:
prepare: []
finish: []
# timer based invocation default, once per day
timer: *-*-* 23:30:00
# first job max time on new repository, eg: 48h (2880min) equals 3,4TB using 20mb/s
initial_job_runtime: 2880min
# max time for fullbackup, eg: 8hours equals 562GB using 20mb/s
max_job_runtime: 480min
# maximum backup storage to expect, -1 (default) to disable checking for current usage
max_backup_storage: -1
# age of oldest data **change** to keep, meaning "what changed less than x ago"
forget: keep-within 1y6m
# interval in days to run restic forget, prune and check
housekeeping_interval_days: 7
# calculate used space on backup storage as post backup step
count_target_data_size: true
# sum the local filesizes of the backuped data as post backup step
count_local_data_size: false
# systemd dependencies
systemd:
after:
wants:
requires:
onfailure:
# root only readable, will be injected in target user environment
env_file: /etc/systemd/system/backup.env
# base directory (used for /tags and /metrics) if /usr/local/gitops-library.sh not found
var_dir: /var/lib/backup-service
default_ssh_port: 22
default_test_repository: {{ default_test_repository }}
{# external software #}
external: {{ backup_external.objects }}
{% endload %}
{%- set settings = salt['grains.filter_by']({'default': defaults},
grain='default', default= 'default', merge= salt['pillar.get']('backup', {})) %}
{# expand ##version## in field external.*.download #}
{% for n,v in settings.external.items() %}
{% set download=settings.external[n]['download']|regex_replace('##version##', v.version) %}
{% do settings.external[n].update( {'download': download} ) %}
{% if settings.external[n]['hash_url'] %}
{% set hash_url=settings.external[n]['hash_url']|regex_replace('##version##', v.version) %}
{% do settings.external[n].update( {'hash_url': hash_url} ) %}
{% endif %}
{% endfor %}