feat(bootstrap): use configurable mirror and write proper sources.list

This commit is contained in:
2026-02-22 10:47:43 +01:00
parent 79988619c6
commit f2eb9f2c8e
4 changed files with 67 additions and 7 deletions

View File

@@ -30,15 +30,24 @@
--keyring=/usr/share/keyrings/ubuntu-archive-keyring.gpg
--include={{ bootstrap_ubuntu_base_csv }}
{{ bootstrap_ubuntu_release }} /mnt
https://archive.ubuntu.com/ubuntu/
{{ system_cfg.mirror }}
register: bootstrap_ubuntu_base_result
changed_when: bootstrap_ubuntu_base_result.rc == 0
- name: Enable universe repository
ansible.builtin.replace:
path: /mnt/etc/apt/sources.list
regexp: '^(deb\s+\S+\s+\S+\s+main)$'
replace: '\1 universe'
- name: Write bootstrap sources.list
ansible.builtin.template:
src: ubuntu.sources.list.j2
dest: /mnt/etc/apt/sources.list
mode: "0644"
- name: Configure apt performance tuning
ansible.builtin.copy:
dest: /mnt/etc/apt/apt.conf.d/99performance
content: |
Acquire::Retries "3";
Acquire::http::Pipeline-Depth "10";
APT::Install-Recommends "false";
mode: "0644"
- name: Update package lists
ansible.builtin.command: "{{ chroot_command }} apt update"