--- - 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_facts['os_family'] == "Archlinux" - name: "Install debian" when: ansible_facts['os_family'] == "Debian" block: - name: "Install ubuntu" ansible.builtin.include_tasks: "install-ubuntu.yml" when: ansible_facts['distribution'] == "Ubuntu" - name: "Install raspberry" ansible.builtin.include_tasks: "install-raspberry.yml" when: ansible_facts['distribution'] == "Debian" and ansible_facts['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 }}"