arch installation mostly works with zfsbootmgr
This commit is contained in:
commit
1444f05d9c
19 changed files with 496 additions and 0 deletions
67
roles/base/tasks/archinstall/initialize_root_zvol.yaml
Normal file
67
roles/base/tasks/archinstall/initialize_root_zvol.yaml
Normal file
|
@ -0,0 +1,67 @@
|
|||
---
|
||||
- name: Check for existing zroot zfs volume
|
||||
command: zpool list -Ho name zroot
|
||||
register: zroot_check
|
||||
ignore_errors: true
|
||||
|
||||
- block:
|
||||
- name: Initialize disk device to id table
|
||||
set_fact:
|
||||
partition_device_to_ids: {}
|
||||
|
||||
- name: Create disk device to id table
|
||||
set_fact:
|
||||
partition_device_to_ids: >-
|
||||
{{
|
||||
partition_device_to_ids
|
||||
| combine({ item.value: (partition_device_to_ids[item.value] | default([])) + [item.key] })
|
||||
}}
|
||||
with_items: "{{ base_partitions_by_id | dict2items }}"
|
||||
|
||||
- name: Create zroot volume
|
||||
become: true
|
||||
command: >-
|
||||
zpool create -f -o ashift=12
|
||||
-o autotrim=on
|
||||
-O devices=off
|
||||
-O relatime=on
|
||||
-O xattr=sa
|
||||
-O acltype=posixacl
|
||||
-O normalization=formD
|
||||
-O compression=lz4
|
||||
-O canmount=off
|
||||
-O mountpoint=none
|
||||
-R /mnt
|
||||
zroot {{ mirror }} {{ base_root_partitions | map('extract', partition_device_to_ids) | flatten | list | join(' ') }}
|
||||
vars:
|
||||
mirror: "{{ 'mirror' if base_root_partitions | length > 1 else '' }}"
|
||||
when: zroot_check.rc != 0
|
||||
|
||||
- name: Create zroot/ROOT and zroot/DATA volumes
|
||||
community.general.zfs:
|
||||
name: "zroot/{{ item }}"
|
||||
state: present
|
||||
register: zfs_zroot_root_volume
|
||||
with_items: [ROOT, DATA]
|
||||
|
||||
- name: Create zroot/ROOT/arch
|
||||
community.general.zfs:
|
||||
name: zroot/ROOT/arch
|
||||
state: present
|
||||
extra_zfs_properties:
|
||||
canmount: noauto
|
||||
mountpoint: /
|
||||
when: zfs_zroot_root_volume.changed
|
||||
|
||||
- name: Create zroot/home
|
||||
community.general.zfs:
|
||||
name: zroot/DATA/home
|
||||
state: present
|
||||
extra_zfs_properties:
|
||||
mountpoint: /home
|
||||
|
||||
- name: Export zroot pool
|
||||
command: zpool export zroot
|
||||
|
||||
- name: Import zroot pool (-R /mnt)
|
||||
command: zpool import -R /mnt zroot -N
|
Loading…
Add table
Add a link
Reference in a new issue