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
@@ -30,6 +30,7 @@ jobs:
|
|||||||
needs: quality
|
needs: quality
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: true
|
||||||
matrix:
|
matrix:
|
||||||
runner-index: [0, 1, 2]
|
runner-index: [0, 1, 2]
|
||||||
steps:
|
steps:
|
||||||
@@ -44,6 +45,7 @@ jobs:
|
|||||||
echo "TEST_PAIRS=$PAIRS" >> $GITHUB_ENV
|
echo "TEST_PAIRS=$PAIRS" >> $GITHUB_ENV
|
||||||
- name: Run molecule tests
|
- name: Run molecule tests
|
||||||
run: |
|
run: |
|
||||||
|
set -e
|
||||||
. .venv/bin/activate
|
. .venv/bin/activate
|
||||||
export DOCKER_HOST="unix:///run/user/$(id -u)/docker.sock"
|
export DOCKER_HOST="unix:///run/user/$(id -u)/docker.sock"
|
||||||
export ANSIBLE_INJECT_INVOCATION=1
|
export ANSIBLE_INJECT_INVOCATION=1
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ gitea_runner_file: ".runner"
|
|||||||
# Docker installation (for rootless dependencies)
|
# Docker installation (for rootless dependencies)
|
||||||
docker_gpg_key_path: "/etc/apt/keyrings/docker.gpg"
|
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_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 }}]
|
deb [arch={{ docker_apt_arch }} signed-by={{ docker_gpg_key_path }}]
|
||||||
https://download.docker.com/linux/{{ ansible_facts['distribution'] | lower }}
|
https://download.docker.com/linux/{{ ansible_facts['distribution'] | lower }}
|
||||||
{{ ansible_facts['distribution_release'] }} stable
|
{{ ansible_facts['distribution_release'] }} stable
|
||||||
|
|||||||
@@ -16,9 +16,10 @@
|
|||||||
when: ansible_facts['os_family'] == 'Debian'
|
when: ansible_facts['os_family'] == 'Debian'
|
||||||
|
|
||||||
- name: Add Docker APT repository (Debian/Ubuntu)
|
- name: Add Docker APT repository (Debian/Ubuntu)
|
||||||
ansible.builtin.apt_repository:
|
ansible.builtin.copy:
|
||||||
repo: "{{ docker_apt_repo }}"
|
dest: /etc/apt/sources.list.d/docker.list
|
||||||
state: present
|
content: "{{ docker_apt_source_line }}\n"
|
||||||
|
mode: "0644"
|
||||||
when: ansible_facts['os_family'] == 'Debian'
|
when: ansible_facts['os_family'] == 'Debian'
|
||||||
|
|
||||||
- name: Update apt cache after adding Docker repo (Debian/Ubuntu)
|
- name: Update apt cache after adding Docker repo (Debian/Ubuntu)
|
||||||
@@ -27,30 +28,6 @@
|
|||||||
cache_valid_time: 0
|
cache_valid_time: 0
|
||||||
when: ansible_facts['os_family'] == 'Debian'
|
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)
|
- name: Install rootless Docker dependencies (Debian/Ubuntu)
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
name:
|
name:
|
||||||
|
|||||||
Reference in New Issue
Block a user