--- - name: "Include distribution vars" ansible.builtin.include_vars: "{{ ansible_facts['distribution'] | lower }}.yml" - name: "Ensure install dependencies are installed on live environment" ansible.builtin.apt: state: "present" update_cache: true pkg: - "debootstrap" - "arch-install-scripts" - "bash" - name: "Run debootstrap" ansible.builtin.command: cmd: "debootstrap {{ bootstrap_opts }} {{ bootstrap_distro.name }} {{ mnt_root_path }} {{ bootstrap_distro.mirror_url }}" 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 apt in chroot" ansible.builtin.copy: dest: "{{ item.dest }}" mode: "0640" content: "{{ item.content }}" loop: - dest: "{{ mnt_root_path }}/etc/apt/preferences.d/ignored-package" content: "{{ bootstrap_apt_ignored_preferences }}" - dest: "{{ mnt_root_path }}/etc/apt/sources.list" content: "{{ bootstrap_apt_sources }}" - name: "Configure system in chroot" ansible.builtin.command: cmd: "arch-chroot {{ mnt_root_path }} {{ item }}" changed_when: true loop: - "apt-get update" - "apt-get install -y {{ bootstrap_distro.packages | join(' ') }}" - name: "Ensure rEFInd bootloader installed" ansible.builtin.command: cmd: "arch-chroot {{ mnt_root_path }} apt-get install -y 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.copy: dest: "{{ mnt_root_path }}/boot/refind_linux.conf" mode: "0644" content: | "Boot with defaults" "root=PARTLABEL={{ partition_root.name }} rw" "Boot to terminal" "root=PARTLABEL={{ partition_root.name }} rw systemd.unit=multi-user.target" - name: "Configure rEFInd settings" ansible.builtin.copy: dest: "{{ mnt_boot_path }}/EFI/refind/refind.conf" mode: "0644" content: | timeout 5 textonly true # NOTE: this is skipped because the docker test doesn't have proper EFI/refind directory created tags: ["molecule-notest"]