From b106f9d9e5370dbf18a1548130d24405e8dbd983 Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Thu, 10 Aug 2023 08:08:42 +0200 Subject: [PATCH] roles/common: ignore apt sources.list on Scaleway While testing Debian 12 on Scaleway I noticed their apt sources.list is in some weird format I've never seen before, so let's skip it on those hosts. --- roles/common/tasks/packages_Debian.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/roles/common/tasks/packages_Debian.yml b/roles/common/tasks/packages_Debian.yml index 631ccaa..f0b08cd 100644 --- a/roles/common/tasks/packages_Debian.yml +++ b/roles/common/tasks/packages_Debian.yml @@ -15,9 +15,17 @@ state: directory when: ansible_distribution_major_version is version('12', '<') + # Scaleway seems to use a weird sources.list format as of Debian 12? + - name: Check for weird Debian sources + ansible.builtin.stat: + path: /etc/apt/sources.list.d/debian.sources + register: weird_debian_sources_stat + - name: Configure apt mirror ansible.builtin.template: src=sources.list.j2 dest=/etc/apt/sources.list owner=root group=root mode=0644 - when: ansible_architecture != 'armv7l' + when: + - ansible_architecture != 'armv7l' + - not weird_debian_sources_stat - name: Set fact for base packages ansible.builtin.set_fact: