Extra settings for hpool

This commit is contained in:
Wojciech Kozlowski 2022-10-12 22:02:11 +02:00
parent e884b30d08
commit bc30de48bc
4 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,17 @@
[Unit]
Description=Load encryption key for ZFS hpool
Documentation=man:zfs(8)
DefaultDependencies=no
After=systemd-udev-settle.service
After=zfs-import.target
After=systemd-remount-fs.service
Before=zfs-mount.service
ConditionPathIsDirectory=/sys/module/zfs
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/sbin/zfs load-key hpool
[Install]
WantedBy=zfs.target

View File

@ -23,6 +23,7 @@
- import_tasks: tasks/hosts/systemd-mail.yml - import_tasks: tasks/hosts/systemd-mail.yml
- import_tasks: tasks/hosts/zfs-scrub.yml - import_tasks: tasks/hosts/zfs-scrub.yml
- import_tasks: tasks/hosts/zfs-trim.yml - import_tasks: tasks/hosts/zfs-trim.yml
- import_tasks: tasks/hosts/zfs-extra.yml
- import_tasks: tasks/hosts/zfsutils-cron.yml - import_tasks: tasks/hosts/zfsutils-cron.yml
- import_tasks: tasks/hosts/ups.yml - import_tasks: tasks/hosts/ups.yml
- import_tasks: tasks/hosts/smart.yml - import_tasks: tasks/hosts/smart.yml

View File

@ -0,0 +1,17 @@
- name: Load hpool keys service file
copy:
src: ./filesystem/{{ ansible_hostname }}/etc/systemd/system/zfs-load-key-hpool.service
dest: /etc/systemd/system/zfs-load-key-hpool.service
mode: 0644
register: systemd_zfs_load_key_hpool_service_file
- name: SystemD daemon reload
systemd:
daemon_reload: true
when:
systemd_zfs_load_key_hpool_service_file is changed
- name: Ensure hpool keys are loaded at boot
systemd:
name: zfs-load-key-hpool.service
enabled: yes

View File

@ -36,3 +36,9 @@
name: zfs-scrub-monthly@rpool.timer name: zfs-scrub-monthly@rpool.timer
enabled: yes enabled: yes
state: started state: started
- name: Enable zfs scrub of hpool
systemd:
name: zfs-scrub-monthly@hpool.timer
enabled: yes
state: started