blob: 02ba1f3bb1745bea14c3ee821ef981aa35c28144 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
---
- name: "Update live environment"
ansible.builtin.command:
cmd: "{{ item }}"
loop:
- "pacman -Syu --noconfirm"
- "pacman -Sy --needed archlinux-keyring --noconfirm"
changed_when: true
failed_when: false
- name: "Run pacstrap"
ansible.builtin.command:
cmd: "pacstrap -K {{ mnt_root_path }} base linux linux-firmware less nano"
changed_when: true
- name: "Generate fstab"
ansible.builtin.shell:
cmd: "genfstab -t PARTLABEL {{ mnt_root_path }} > {{ mnt_root_path }}/etc/fstab"
changed_when: true
- name: "Configure pacman in chroot"
ansible.builtin.copy:
src: "/etc/pacman.conf"
dest: "{{ mnt_root_path }}/etc/pacman.conf"
remote_src: true
force: false
mode: "0644"
- name: "Configure system in chroot"
ansible.builtin.command:
cmd: "arch-chroot {{ mnt_root_path }} {{ item }}"
changed_when: true
loop:
- "pacman-key --init"
- "pacman-key --populate"
- "pacman -Syyu --noconfirm"
- name: "Ensure rEFInd bootloader installed"
ansible.builtin.command:
cmd: "arch-chroot {{ mnt_root_path }} pacman -S --noconfirm refind"
changed_when: true
- name: "Install rEFInd"
ansible.builtin.command:
cmd: "arch-chroot {{ mnt_root_path }} refind-install"
changed_when: true
- name: "Configure rEFInd boot options"
ansible.builtin.template:
src: "refind_linux.conf.j2"
dest: "{{ mnt_root_path }}/boot/refind_linux.conf"
mode: "0644"
- name: "Configure rEFInd settings"
ansible.builtin.template:
src: "refind.conf.j2"
dest: "{{ mnt_boot_path }}/EFI/refind/refind.conf"
mode: "0644"
# NOTE: this is skipped because the docker test doesn't have proper EFI/refind directory created
tags: ["molecule-notest"]
- name: "Configure pacman hook for rEFInd kernel updates"
ansible.builtin.copy:
dest: "{{ mnt_root_path }}/etc/pacman.d/100-refind.hook"
mode: "0644"
content: |
[Trigger]
Type = Package
Operation = Install
Operation = Upgrade
Target = linux
[Action]
Description = Updating rEFInd after kernel update
When = PostTransaction
Exec = /usr/bin/refind-install
- name: "Ensure ansible dependencies are installed in chroot"
ansible.builtin.command:
cmd: "arch-chroot {{ mnt_root_path }} pacman -S --noconfirm python3"
changed_when: true
- name: "Install broadcom-wl driver"
ansible.builtin.command:
cmd: "arch-chroot {{ mnt_root_path }} pacman -S --noconfirm broadcom-wl"
changed_when: true
when: bootstrap_mac
- name: "Blacklist modules conflicting with broadcom-wl"
ansible.builtin.copy:
dest: "{{ mnt_root_path }}/etc/modprobe.d/broadcom-wl.conf"
mode: "0644"
content: |
blacklist brcmfmac
blacklist brcmutil
blacklist b43
blacklist ssb
blacklist bcma
when: bootstrap_mac
- name: "Load wl module at boot"
ansible.builtin.copy:
dest: "{{ mnt_root_path }}/etc/modules-load.d/broadcom-wl.conf"
mode: "0644"
content: |
wl
when: bootstrap_mac
|