fix(offline): skip online repos for docker/nodejs and add ubuntu 26.04 support

This commit is contained in:
Haitao Pan 2026-06-17 20:43:16 +08:00
parent c1162f7ea2
commit 532c57a359
2 changed files with 7 additions and 3 deletions

View File

@ -3,7 +3,7 @@
ansible.builtin.set_fact:
docker_platform: >-
{{
'ubuntu' if ansible_distribution == 'Ubuntu' and ansible_distribution_version in ['22.04', '24.04']
'ubuntu' if ansible_distribution == 'Ubuntu' and ansible_distribution_version in ['22.04', '24.04', '26.04']
else 'debian' if ansible_distribution == 'Debian' and (ansible_distribution_major_version | int) in [11, 12, 13]
else 'rocky' if ansible_distribution == 'Rocky' and (ansible_distribution_major_version | int) in [8, 9, 10]
else 'unsupported'
@ -33,7 +33,7 @@
ansible.builtin.assert:
that: docker_platform != 'unsupported'
fail_msg: >-
Docker installation is only supported on Debian 11/12/13, Ubuntu 22.04/24.04, and Rocky Linux 8/9/10.
Docker installation is only supported on Debian 11/12/13, Ubuntu 22.04/24.04/26.04, and Rocky Linux 8/9/10.
- name: Install Docker on Ubuntu
when: docker_platform == 'ubuntu'
@ -63,6 +63,7 @@
until: docker_gpg_download is succeeded
retries: 5
delay: 3
when: not docker_offline_active | default(false)
- name: Add Docker repository
ansible.builtin.apt_repository:
@ -71,6 +72,7 @@
https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} {{ docker_channel }}
state: present
filename: docker
when: not docker_offline_active | default(false)
- name: Install Docker Engine packages
ansible.builtin.apt:
@ -111,6 +113,7 @@
until: docker_gpg_download is succeeded
retries: 5
delay: 3
when: not docker_offline_active | default(false)
- name: Add Docker repository
ansible.builtin.apt_repository:
@ -119,6 +122,7 @@
https://download.docker.com/linux/debian {{ ansible_distribution_release }} {{ docker_channel }}
state: present
filename: docker
when: not docker_offline_active | default(false)
- name: Install Docker Engine packages
ansible.builtin.apt:

View File

@ -88,7 +88,7 @@
- name: Install Node.js (exact version)
apt:
name:
- "{{ 'nodejs=' + nodejs_version_pin + '-1nodesource1' if nodejs_version_pin != '' else 'nodejs' }}"
- "{{ 'nodejs' if nodejs_offline_active else ('nodejs=' + nodejs_version_pin + '-1nodesource1' if nodejs_version_pin != '' else 'nodejs') }}"
state: present
allow_downgrade: true
update_cache: yes