Add mount for ZFS and zfs-load-key unit file

This commit is contained in:
Benoit S 2021-01-31 20:05:25 +09:00
parent d995cfc671
commit 2b87d50a1d
2 changed files with 19 additions and 0 deletions

View file

@ -0,0 +1,13 @@
[Unit]
Description=Load encryption keys
DefaultDependencies=no
After=zfs-import.target
Before=zfs-mount.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/sbin/zfs load-key -a
[Install]
WantedBy=zfs-mount.service

View file

@ -105,3 +105,9 @@ if not host.fact.command('zfs list | grep exports || true'):
name='Create ZFS volume exports',
commands=['zfs create local/exports -o mountpoint=/var/backups/lxd']
)
server.shell(
name='Mount local/exports',
commands=['zfs mount local/exports'],
)