feat(bootstrap): use configurable mirror and write proper sources.list
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user