Update to 2021-12-01 19:13

This commit is contained in:
Daniel Berteaud
2021-12-01 19:13:34 +01:00
commit 4c4556c660
2153 changed files with 60999 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
# {{ ansible_managed }}
{% if zfs_repl_recv %}
Defaults:zfs-recv !requiretty
Cmnd_Alias ZFS_RECV = /sbin/zfs
zfs-recv ALL=(root) NOPASSWD: ZFS_RECV
{% endif %}

View File

@@ -0,0 +1,19 @@
{% for zfs in zfs_snap %}
[{{ zfs.name }}]
use_template = default
recursive = {{ zfs.recursive | default('yes') }}
{% for key in zfs.keys() | list | difference(['name','recursive']) %}
{{ key }} = {{ zfs[key] }}
{% endfor %}
{% endfor %}
[template_default]
frequently = {{ zfs_snap_frequently }}
hourly = {{ zfs_snap_hourly }}
daily = {{ zfs_snap_daily }}
weekly = {{ zfs_snap_weekly }}
monthly = {{ zfs_snap_monthly }}
yearly = {{ zfs_snap_yearly }}
autosnap = {{ zfs_repl_recv | ternary('no', 'yes') }}
autoprune = yes

View File

@@ -0,0 +1,9 @@
[Unit]
Description=Snapshot ZFS Pool
Requires=zfs.target
After=zfs.target
[Service]
Environment=TZ=UTC
Type=oneshot
ExecStart=/usr/sbin/sanoid --cron

View File

@@ -0,0 +1,10 @@
[Unit]
Description=Run Sanoid
[Timer]
OnCalendar=*:0/1
Persistent=true
[Install]
WantedBy=timers.target

View File

@@ -0,0 +1,10 @@
[Unit]
Description=Sync ZFS datasets
[Service]
Type=oneshot
PrivateTmp=yes
ExecStart=/sbin/syncoid --identifier={{ item.1.id }}{% if item.1.force | default(True) %} --force-delete {% endif %}{% if item.1.compress | default('lz4') is string %}--compress={{ item.1.compress | default('lz4') }} {%elif item.1.compress | default('lz4') == True %}--compress {% endif %}{% if item.1.recursive | default(True) == True %}--recursive{% endif %} {% if item.1.skip_parent | default(True) == True %}--skip-parent {% endif %} --sshcipher={{ item.1.ssh_cipher | default('aes128-ctr') }} {% if item.1.ssh_port is defined %}--sshport={{ item.1.ssh_port }} {% endif %}{% if item.1.bw_limit is defined %}--source-bwlimit={{ item.1.bw_limit }} {% endif %}{{ item.1.syncoid_opts | default('') }} {{ item.1.dataset }} {{ item.1.dest }}
{% if item.1.max_duration is defined %}
TimeoutSec={{ item.1.max_duration }}
{% endif %}

View File

@@ -0,0 +1,8 @@
[Unit]
Description=Sync ZFS datasets
[Timer]
OnCalendar={{ item.1.freq | default('daily') }}
[Install]
WantedBy=timers.target

View File

@@ -0,0 +1,9 @@
[Unit]
Description=ZFS pool scrub
Requires=zfs.target
After=zfs.target
[Service]
Type=oneshot
ExecStartPre=-/sbin/zpool scrub -s %I
ExecStart=/sbin/zpool scrub %I

View File

@@ -0,0 +1,9 @@
[Unit]
Description=Regular ZFS pool scrub
[Timer]
OnCalendar={{ zfs_scrub_freq }}
Persistent=true
[Install]
WantedBy=timers.target

View File

@@ -0,0 +1,9 @@
[Unit]
Description=ZFS pool trim
Requires=zfs.target
After=zfs.target
[Service]
Type=oneshot
PrivateTmp=yes
ExecStart=/sbin/zpool trim %I

View File

@@ -0,0 +1,9 @@
[Unit]
Description=Regular ZFS pool trim
[Timer]
OnCalendar={{ zfs_trim_freq }}
Persistent=true
[Install]
WantedBy=timers.target