summaryrefslogtreecommitdiffstats
path: root/roles/bootstrap/tasks/main.yml
blob: f74e743c0522c7d405eb45f8616bbc6ec340410a (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
---
- name: "Set root,boot partition paths"
  ansible.builtin.set_fact:
    # noqa: var-naming[no-role-prefix] as these facts are used for multiple roles and is easier read this way
    mnt_boot_path: "{{ partition_boot.mount_path }}"
    mnt_root_path: "{{ partition_root.mount_path }}"

- name: "Install archlinux"
  ansible.builtin.include_tasks: "install-archlinux.yml"
  when: ansible_os_family == "Archlinux"

- name: "Install debian"
  when: ansible_os_family == "Debian"
  block:
    - name: "Install ubuntu"
      ansible.builtin.include_tasks: "install-ubuntu.yml"
      when: ansible_distribution == "Ubuntu"

    - name: "Install raspberry"
      ansible.builtin.include_tasks: "install-raspberry.yml"
      when: ansible_distribution == "Debian" and ansible_architecture == "aarch64"

    - name: "Ensure ansible dependencies are installed in chroot"
      ansible.builtin.command:
        cmd: "arch-chroot {{ mnt_root_path }} apt-get install -y python3"
      changed_when: true

- name: "Configure hostname in chroot"
  ansible.builtin.copy:
    dest: "{{ mnt_root_path }}/etc/hostname"
    mode: "0644"
    content: "{{ hostname }}"