Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Arch Linux
infrastructure
Commits
26c3202c
Verified
Commit
26c3202c
authored
Jun 17, 2020
by
Sven-Hendrik Haase
Browse files
install_arch: Don't hardcode system disks
parent
e82d5cc8
Changes
1
Hide whitespace changes
Inline
Side-by-side
roles/install_arch/tasks/main.yml
View file @
26c3202c
...
...
@@ -23,28 +23,28 @@
register
:
sgdisk
changed_when
:
"
sgdisk.rc
==
0"
-
name
:
partition and format the disks (btrfs)
command
:
mkfs.btrfs -f -L root -d {{ raid_level|default(raid1) }} -m {{ raid_level|default(raid1) }} -O no-holes
/dev/sda2 /dev/sdb2
-
name
:
partition and format the disks (btrfs
RAID
)
command
:
mkfs.btrfs -f -L root -d {{ raid_level|default(
'
raid1
'
) }} -m {{ raid_level|default(
'
raid1
'
) }} -O no-holes
{{ system_disks | map('regex_replace', '^(.*)$', '\1p2') | join(' ') }}
when
:
filesystem == "btrfs" and system_disks|length ==
2
-
name
:
partition and format the disks (btrfs)
command
:
mkfs.btrfs -f -L root -d single -m single -O no-holes
/dev/sda
2
-
name
:
partition and format the disks (btrfs
single
)
command
:
mkfs.btrfs -f -L root -d single -m single -O no-holes
{{ system_disks[0] }}p
2
when
:
filesystem == "btrfs" and system_disks|length ==
1
-
name
:
create MDADM array
command
:
mdadm --create --level=1 --raid-devices=2 --run /dev/md0
/dev/sda2 /dev/sdb2
command
:
mdadm --create --level=1 --raid-devices=2 --run /dev/md0
{{ system_disks | map('regex_replace', '(.*)', '^\1p2$') | join(' ') }}
when
:
filesystem != "btrfs" and system_disks|length ==
2
-
name
:
format the MDADM array
filesystem
:
dev=/dev/md0 fstype={{ filesystem|default(ext4) }}
filesystem
:
dev=/dev/md0 fstype={{ filesystem|default(
'
ext4
'
) }}
when
:
filesystem != "btrfs" and system_disks|length ==
2
-
name
:
mount the filesystem (btrfs)
mount
:
src="
/dev/sda
2" path=/mnt state=mounted fstype=btrfs opts="compress=zstd,space_cache=v2"
mount
:
src="
{{ system_disks[0] }}p
2" path=/mnt state=mounted fstype=btrfs opts="compress=zstd,space_cache=v2"
when
:
filesystem == "btrfs"
-
name
:
mount the filesystem
mount
:
name=/mnt src=/dev/md0 state=mounted fstype={{ filesystem|default(ext4) }}
-
name
:
mount the filesystem
(ext4 RAID)
mount
:
name=/mnt src=/dev/md0 state=mounted fstype={{ filesystem|default(
'
ext4
'
) }}
when
:
filesystem != "btrfs" and system_disks|length ==
2
-
name
:
touch LOCK file on mountpoint
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment