Browse Source

Move zfs-scrub template to git-crypt file

lxd-local
Benoît S. 2 months ago
parent
commit
999b601432
  1. 1
      .gitattributes
  2. 4
      files/zfs-scrub.sh_clear
  3. 4
      setup-zfs-and-lxd.py

1
.gitattributes

@ -1,2 +1,3 @@
files/sasl_passwd filter=git-crypt diff=git-crypt
files/borgmatic.yaml filter=git-crypt diff=git-crypt
files/zfs-scrub.sh filter=git-crypt diff=git-crypt

4
templates/zfs-scrub.sh.j2 → files/zfs-scrub.sh_clear

@ -2,7 +2,7 @@
# https://serverfault.com/questions/538978/how-to-run-a-command-once-a-zfs-scrub-completes
set -euo pipefail
curl -m 10 --retry 5 {{ host.data.zfs_healthchecks }}/start
curl -m 10 --retry 5 <healthchecks_url>/start
zpool scrub local
# wait until scrub is finished
while zpool status local | grep -q 'scan: *scrub in progress'; do
@ -14,5 +14,5 @@ zpool status local
# Get stdout from journalctl
LOG=$(journalctl -o cat -u zfs-scrub.service -n 100)
curl -fsS -m 10 --retry 5 --data-raw "$LOG" {{ host.data.zfs_healthchecks }}
curl -fsS -m 10 --retry 5 --data-raw "$LOG" <healthchecks_url>
exit 0

4
setup-zfs-and-lxd.py

@ -40,9 +40,9 @@ if not host.fact.command('lxc storage volume list default | grep images || true'
commands=['lxc storage volume create default images', 'lxc config set storage.images_volume default/images']
)
files.template(
files.put(
name='Push zfs-scrub script',
src='templates/zfs-scrub.sh.j2',
src='files/zfs-scrub.sh',
dest='/usr/local/bin/zfs-scrub.sh',
mode='700',
user='root',

Loading…
Cancel
Save