fix(bootstrap): deploy all non-EOL core distros (keyrings, repos, versions)
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
# ubuntu = latest non-LTS, ubuntu-lts = latest LTS
|
||||
bootstrap_ubuntu_release_map:
|
||||
ubuntu: questing
|
||||
ubuntu-lts: noble
|
||||
bootstrap_ubuntu_release: "{{ bootstrap_ubuntu_release_map[os] | default('noble') }}"
|
||||
ubuntu-lts: resolute
|
||||
bootstrap_ubuntu_release: "{{ bootstrap_ubuntu_release_map[os] | default('resolute') }}"
|
||||
_config: "{{ lookup('vars', bootstrap_var_key) }}"
|
||||
bootstrap_ubuntu_base_csv: "{{ (['ca-certificates'] + _config.base) | unique | join(',') }}"
|
||||
bootstrap_ubuntu_extra_args: >-
|
||||
@@ -24,13 +24,25 @@
|
||||
fail_msg: "{{ bootstrap_var_key }} must be a dict with base/extra/conditional keys."
|
||||
quiet: true
|
||||
|
||||
- name: Check for a debootstrap script for the target release
|
||||
ansible.builtin.stat:
|
||||
path: "/usr/share/debootstrap/scripts/{{ bootstrap_ubuntu_release }}"
|
||||
register: bootstrap_ubuntu_script
|
||||
|
||||
- name: Symlink a missing debootstrap script to the ubuntu base
|
||||
ansible.builtin.file:
|
||||
src: gutsy
|
||||
dest: "/usr/share/debootstrap/scripts/{{ bootstrap_ubuntu_release }}"
|
||||
state: link
|
||||
when: not bootstrap_ubuntu_script.stat.exists
|
||||
|
||||
- name: Install Ubuntu base system
|
||||
ansible.builtin.command: >-
|
||||
debootstrap
|
||||
--keyring=/usr/share/keyrings/ubuntu-archive-keyring.gpg
|
||||
--include={{ bootstrap_ubuntu_base_csv }}
|
||||
{{ bootstrap_ubuntu_release }} /mnt
|
||||
{{ system_cfg.mirror }}
|
||||
{{ system_cfg.mirror | default('http://archive.ubuntu.com/ubuntu', true) }}
|
||||
register: bootstrap_ubuntu_base_result
|
||||
changed_when: bootstrap_ubuntu_base_result.rc == 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user