fix: fail-fast CI, write Docker apt source directly, fix arch mapping
Three changes: 1. CI: add set -e and fail-fast: true to stop on first molecule failure instead of continuing (all pairs fail for same reason anyway) 2. Docker APT repo: use copy module to write sources.list directly instead of apt_repository module which wasn't picking up the repo 3. Fix arch mapping: ansible_facts returns x86_64, Docker repo needs amd64 Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
parent
8af88efeb5
commit
084ea49523
@@ -32,7 +32,7 @@ gitea_runner_file: ".runner"
|
||||
# Docker installation (for rootless dependencies)
|
||||
docker_gpg_key_path: "/etc/apt/keyrings/docker.gpg"
|
||||
docker_apt_arch: "{{ 'amd64' if ansible_facts['architecture'] == 'x86_64' else ansible_facts['architecture'] }}"
|
||||
docker_apt_repo: >-
|
||||
docker_apt_source_line: >-
|
||||
deb [arch={{ docker_apt_arch }} signed-by={{ docker_gpg_key_path }}]
|
||||
https://download.docker.com/linux/{{ ansible_facts['distribution'] | lower }}
|
||||
{{ ansible_facts['distribution_release'] }} stable
|
||||
|
||||
@@ -16,9 +16,10 @@
|
||||
when: ansible_facts['os_family'] == 'Debian'
|
||||
|
||||
- name: Add Docker APT repository (Debian/Ubuntu)
|
||||
ansible.builtin.apt_repository:
|
||||
repo: "{{ docker_apt_repo }}"
|
||||
state: present
|
||||
ansible.builtin.copy:
|
||||
dest: /etc/apt/sources.list.d/docker.list
|
||||
content: "{{ docker_apt_source_line }}\n"
|
||||
mode: "0644"
|
||||
when: ansible_facts['os_family'] == 'Debian'
|
||||
|
||||
- name: Update apt cache after adding Docker repo (Debian/Ubuntu)
|
||||
@@ -27,30 +28,6 @@
|
||||
cache_valid_time: 0
|
||||
when: ansible_facts['os_family'] == 'Debian'
|
||||
|
||||
- name: Debug apt sources (Debian/Ubuntu)
|
||||
ansible.builtin.shell: |
|
||||
set -o pipefail
|
||||
cat /etc/apt/sources.list.d/*.list /etc/apt/sources.list 2>/dev/null | grep -i docker || true
|
||||
register: apt_docker_sources
|
||||
changed_when: false
|
||||
when: ansible_facts['os_family'] == 'Debian'
|
||||
|
||||
- name: Show apt docker sources
|
||||
ansible.builtin.debug:
|
||||
var: apt_docker_sources.stdout_lines
|
||||
when: ansible_facts['os_family'] == 'Debian'
|
||||
|
||||
- name: Debug apt-cache search docker-ce
|
||||
ansible.builtin.shell: apt-cache search docker-ce 2>/dev/null || true
|
||||
register: apt_search_result
|
||||
changed_when: false
|
||||
when: ansible_facts['os_family'] == 'Debian'
|
||||
|
||||
- name: Show apt-cache search result
|
||||
ansible.builtin.debug:
|
||||
var: apt_search_result.stdout_lines
|
||||
when: ansible_facts['os_family'] == 'Debian'
|
||||
|
||||
- name: Install rootless Docker dependencies (Debian/Ubuntu)
|
||||
ansible.builtin.apt:
|
||||
name:
|
||||
|
||||
Reference in New Issue
Block a user