mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-07-26 15:55:56 +02:00
Update to 2021-12-01 19:13
This commit is contained in:
6
roles/zfs/templates/recv-sudo.j2
Normal file
6
roles/zfs/templates/recv-sudo.j2
Normal 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 %}
|
19
roles/zfs/templates/sanoid.conf.j2
Normal file
19
roles/zfs/templates/sanoid.conf.j2
Normal 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
|
9
roles/zfs/templates/sanoid.service.j2
Normal file
9
roles/zfs/templates/sanoid.service.j2
Normal 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
|
10
roles/zfs/templates/sanoid.timer.j2
Normal file
10
roles/zfs/templates/sanoid.timer.j2
Normal file
@@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=Run Sanoid
|
||||
|
||||
[Timer]
|
||||
OnCalendar=*:0/1
|
||||
Persistent=true
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
|
10
roles/zfs/templates/syncoid.service.j2
Normal file
10
roles/zfs/templates/syncoid.service.j2
Normal 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 %}
|
8
roles/zfs/templates/syncoid.timer.j2
Normal file
8
roles/zfs/templates/syncoid.timer.j2
Normal file
@@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=Sync ZFS datasets
|
||||
|
||||
[Timer]
|
||||
OnCalendar={{ item.1.freq | default('daily') }}
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
9
roles/zfs/templates/zfs-scrub@.service.j2
Normal file
9
roles/zfs/templates/zfs-scrub@.service.j2
Normal 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
|
9
roles/zfs/templates/zfs-scrub@.timer.j2
Normal file
9
roles/zfs/templates/zfs-scrub@.timer.j2
Normal file
@@ -0,0 +1,9 @@
|
||||
[Unit]
|
||||
Description=Regular ZFS pool scrub
|
||||
|
||||
[Timer]
|
||||
OnCalendar={{ zfs_scrub_freq }}
|
||||
Persistent=true
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
9
roles/zfs/templates/zfs-trim@.service.j2
Normal file
9
roles/zfs/templates/zfs-trim@.service.j2
Normal 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
|
9
roles/zfs/templates/zfs-trim@.timer.j2
Normal file
9
roles/zfs/templates/zfs-trim@.timer.j2
Normal file
@@ -0,0 +1,9 @@
|
||||
[Unit]
|
||||
Description=Regular ZFS pool trim
|
||||
|
||||
[Timer]
|
||||
OnCalendar={{ zfs_trim_freq }}
|
||||
Persistent=true
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
Reference in New Issue
Block a user