You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.4 KiB
48 lines
1.4 KiB
3 years ago
|
---
|
||
|
- name: Generate fstab.
|
||
|
include_role:
|
||
|
name: genfstab
|
||
|
vars:
|
||
|
chroot: "{{ partitioning_root_mount_point }}"
|
||
|
|
||
|
- name: Check if btrfs-progs is installed.
|
||
|
command: arch-chroot {{ partitioning_root_mount_point }}
|
||
|
pacman -Qk btrfs-progs
|
||
|
register: _btrfs_progs_installed
|
||
|
failed_when: false
|
||
|
changed_when: false
|
||
|
|
||
|
- name: Install btrfs-progs.
|
||
|
command: arch-chroot {{ partitioning_root_mount_point }}
|
||
|
pacman -Sy btrfs-progs --noconfirm
|
||
|
when: _btrfs_progs_installed.rc != 0
|
||
|
|
||
|
- name: Create crypto keyfile.
|
||
|
shell:
|
||
|
cmd: |
|
||
|
set -e -o pipefail
|
||
|
dd bs=512 count=8 if=/dev/urandom of={{ partitioning_root_mount_point }}/crypto_keyfile.bin
|
||
|
echo {{ partitioning_priv_luks_password }} \
|
||
|
| cryptsetup luksAddKey {{ partitioning_priv_luks_device_node }} \
|
||
|
{{ partitioning_root_mount_point }}/crypto_keyfile.bin
|
||
|
creates: "{{ partitioning_root_mount_point }}/crypto_keyfile.bin"
|
||
|
|
||
|
- name: Set proper permissions on crypto keyfile.
|
||
|
file:
|
||
|
path: "{{ partitioning_root_mount_point }}/crypto_keyfile.bin"
|
||
|
mode: 0000
|
||
|
|
||
|
- name: Configure mkinitcpio.
|
||
|
mkinitcpio:
|
||
|
state: present
|
||
|
path: "{{ partitioning_root_mount_point }}/etc/mkinitcpio.conf"
|
||
|
binaries: /usr/bin/btrfs
|
||
|
files: /crypto_keyfile.bin
|
||
|
hooks:
|
||
|
- encrypt
|
||
|
- btrfs
|
||
|
|
||
|
- name: Run mkinitcpio.
|
||
|
command: arch-chroot {{ partitioning_root_mount_point }} mkinitcpio -P
|
||
|
changed_when: true
|