1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
---
- name: Basic Setup
hosts: sk-2019
roles:
- role: base
- role: sshd
- role: zsh
- role: admin-user
- role: cryptdisk
- role: zfs/base
tasks:
- name: install post-boot script
copy:
dest: /usr/local/bin/post-boot
mode: 0755
content: |
#!/bin/bash
set -e
{% for name, volume in cryptdisk_volumes.items() %}
cryptsetup luksOpen '{{ volume.device }}' '{{ name }}'
{% endfor %}
systemctl restart zfs-import-cache.service
systemctl restart zfs-mount.service
mount -a
### TODO:
#
# zfs create -o quota=30G storage/mysql
# zfs create -o quota=30G storage/automysqlbackup
# zfs create -o quota=300G storage/vmail
# zfs create -o quota=600G storage/www
# zfs create -o quota=40G storage/log
# zfs create -o quota=50G storage/configz
#
# mkdir -p /var/lib/mysql /var/lib/automysqlbackup /var/vmail /var/www /var/log/ispconfig
# chmod 0000 /var/lib/mysql /var/lib/automysqlbackup /var/vmail /var/www /var/log/ispconfig
# chattr +i /var/lib/mysql /var/lib/automysqlbackup /var/vmail /var/www /var/log/ispconfig
#
### add to /etc/fstab:
##
## /srv/storage/mysql /var/lib/mysql none defaults,bind,x-systemd.automount,nofail 0 0
## /srv/storage/automysqlbackup /var/lib/automysqlbackup none defaults,bind,x-systemd.automount,nofail 0 0
## /srv/storage/vmail /var/vmail none defaults,bind,x-systemd.automount,nofail 0 0
## /srv/storage/www /var/www none defaults,bind,x-systemd.automount,nofail 0 0
## /srv/storage/log /var/log/ispconfig none defaults,bind,x-systemd.automount,nofail 0 0
#
# mount -a
#
|