ansible/roles/cryptoraid/tasks/alpine.yml

53 lines
1011 B
YAML
Raw Normal View History

2022-09-27 10:27:00 +02:00
---
- name: install packages
apk:
name:
2022-10-20 15:03:12 +02:00
- btrbk
2022-10-20 16:17:37 +02:00
- coreutils # needed by btrbk
2022-10-03 18:30:24 +02:00
- btrfs-progs
- cryptsetup
- gnupg
2022-09-27 10:27:00 +02:00
- gptfdisk
- sgdisk
- zstd
- name: load btrfs module
modprobe:
name: btrfs
state: present
- name: btrfs module on startup
lineinfile:
path: /etc/modules
line: btrfs
insertafter: EOF
2022-10-03 18:30:24 +02:00
2022-10-19 11:21:27 +02:00
- name: add drive block to dmcrypt config
blockinfile:
insertbefore: leave this comment last
path: /etc/conf.d/dmcrypt
block: "{{ lookup('template', 'dmcrypt_block.j2') }}"
- name: enable dmcrypt at boot
service:
name: dmcrypt
enabled: true
runlevel: boot
- name: copy btrfs-scan init script
copy:
dest: /etc/init.d/btrfs-scan
src: btrfs-scan
mode: '0755'
- name: add btrfs-scan init script to lbu
lbu:
include: /etc/init.d/btrfs-scan
2022-10-19 17:58:20 +02:00
when: alpine_mode in ["diskless", "data"]
- name: enable btrfs-scan at boot
service:
name: btrfs-scan
enabled: true
runlevel: boot