Files
distcloud/tools/gate/roles/install-stx-custom-deps/tasks/main.yaml
Leonardo Fagundes Luz Serrano 8e5ed90f19 Tox/Zuul: Ignore STX mirror unreachable error
The install-stx-custom-deps playbook that is used
to pull STX versions of dependencies before running
the py39 zuul job would fail if the STX mirror was
unreachable. Even worse, the error message would
simply say "Failed to update apt cache: unknown reason"

Changes:
- More logs when running apt update
- Will no longer fail if STX mirror is unreachable

Test Plan:
pass: works when STX mirror is reachable
pass: works when STX mirror is unreachable

Closes-Bug: 2117173

Change-Id: Ia51feb681e5579e620adb20158b60a148dc2c6ee
Signed-off-by: Leonardo Fagundes Luz Serrano <Leonardo.FagundesLuzSerrano@windriver.com>
2025-07-17 15:14:13 +00:00

33 lines
854 B
YAML

---
- name: Assert STX master apt repo file exists
file:
path: "{{ stx_master_repo_file }}"
owner: "root"
group: "root"
mode: "0644"
state: "touch"
become: true
- name: Configure STX master apt repo
lineinfile:
line: "deb [trusted=yes] {{ stx_master_repo }} /"
state: "present"
path: "{{ stx_master_repo_file }}"
become: true
# Using this instead of ansible's "apt_repository"
# because it provides better logs.
# Note it DOES NOT FAIL the playbook, even if some repo can't be reached
- name: Apt update
command: "apt update"
become: true
# This will still fail if one of the required pkgs can't
# be found on any reachable apt repo
- name: Install dependencies from STX master package repo
package:
name: "{{ item }}"
state: present
become: true
with_items: "{{ stx_master_deps }}"