blob: 057a6394434db8fe88c3fe0707b54bcc6cd7bae9 (
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
|
---
- name: "Run pacstrap"
ansible.builtin.command:
cmd: "pacstrap -K {{ mnt_root_path }} base linux linux-firmware"
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: "Run bootclt"
ansible.builtin.command:
cmd: "arch-chroot {{ mnt_root_path }} bootctl install"
changed_when: true
- name: "Enable systemd-boot-update"
ansible.builtin.command:
cmd: "arch-chroot {{ mnt_root_path }} systemctl enable systemd-boot-update"
changed_when: false
- name: "Template systemd-boot files"
ansible.builtin.template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: "0644"
with_items:
- src: "loader.conf.j2"
dest: "{{ mnt_boot_path }}/loader/loader.conf"
- src: "archlinux.conf.j2"
dest: "{{ mnt_boot_path }}/loader/entries/archlinux.conf"
- name: "Configure hostname in chroot"
ansible.builtin.copy:
dest: "{{ mnt_root_path }}/etc/hostname"
mode: "0644"
content: "{{ hostname }}"
- 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: "Ensure pacman is updated in chroot"
ansible.builtin.shell: |
arch-chroot {{ mnt_root_path }} pacman-key --init
arch-chroot {{ mnt_root_path }} pacman-key --populate
arch-chroot {{ mnt_root_path }} pacman -Syyu --noconfirm
changed_when: true
- name: "Ensure ansible dependencies are installed in chroot"
ansible.builtin.command:
cmd: "arch-chroot {{ mnt_root_path }} pacman -S --noconfirm python3"
changed_when: true
|