Update to 2021-01-26 17:00

master
Daniel Berteaud 4 years ago
parent 3849618d5d
commit 92749ddfe4
  1. 9
      roles/zfs/files/z_resume_scrubs
  2. 9
      roles/zfs/files/z_suspend_scrubs
  3. 7
      roles/zfs/tasks/main.yml

@ -0,0 +1,9 @@
#!/bin/bash -e
# Resume all suspended pool scrubs
for ZPOOL in $(zpool list -H -o name); do
if [ $(zpool status $ZPOOL | grep -c 'scrub paused') -ge 1 ]; then
echo scrub paused for pool $ZPOOL, resuming it
zpool scrub $ZPOOL
fi
done

@ -0,0 +1,9 @@
#!/bin/bash -e
# Suspend any running pool scrubs
for ZPOOL in $(zpool list -H -o name); do
if [ $(zpool status $ZPOOL | grep -c 'scrub in progress') -ge 1 ]; then
echo scrub running for pool $ZPOOL, suspending it
zpool scrub -p $ZPOOL
fi
done

@ -30,6 +30,13 @@
template: src=recv-sudo.j2 dest=/etc/sudoers.d/zfs_recv owner=root group=root mode=440 validate='visudo -cf %s' template: src=recv-sudo.j2 dest=/etc/sudoers.d/zfs_recv owner=root group=root mode=440 validate='visudo -cf %s'
tags: zfs tags: zfs
- name: Deploy pool scrub suspend and resume scripts
copy: src={{ item }} dest=/usr/local/bin/{{ item }} mode=755
loop:
- z_suspend_scrubs
- z_resume_scrubs
tags: zfs
- name: Deploy ssh keys for zfs-recv - name: Deploy ssh keys for zfs-recv
authorized_key: authorized_key:
user: zfs-recv user: zfs-recv

Loading…
Cancel
Save