2023-08-21 17:19:29 -04:00
|
|
|
- name: Deploy keyfile
|
|
|
|
copy:
|
2023-08-26 22:02:29 -04:00
|
|
|
src: "{{ inventory_hostname }}.secret"
|
2023-08-21 17:19:29 -04:00
|
|
|
dest: /k5e
|
|
|
|
mode: 0600
|
|
|
|
|
|
|
|
- name: Setup crypttab
|
|
|
|
community.general.crypttab:
|
|
|
|
backing_device: "{{ external_disk_dev }}"
|
|
|
|
name: disk
|
|
|
|
state: present
|
|
|
|
password: /k5e
|
|
|
|
|
|
|
|
- name: Decrypt secondary disk
|
|
|
|
luks_device:
|
|
|
|
device: "{{ external_disk_dev }}"
|
|
|
|
keyfile: /k5e
|
|
|
|
name: disk
|
|
|
|
state: opened
|
|
|
|
|
|
|
|
- name: Setup fstab
|
|
|
|
mount:
|
|
|
|
path: /mnt/disk
|
|
|
|
src: /dev/mapper/disk
|
|
|
|
state: mounted
|
|
|
|
fstype: ext4
|
2023-09-10 20:19:51 -04:00
|
|
|
|
|
|
|
- name: Create data root dir
|
|
|
|
file:
|
|
|
|
path: "{{ dataroot }}"
|
|
|
|
state: directory
|