From d58165351a00428347da8516cfa2ffaba297f184 Mon Sep 17 00:00:00 2001 From: Gerlando Falauto Date: Wed, 17 Apr 2024 17:08:11 +0200 Subject: [PATCH] fix(molecule, debian): workaround for debian10 buster-backports (#478) apparently debian-backports has been archived from live debian repositories, leading to the following error messages when running molecule tests: fatal: [debian-10-x86_64]: FAILED! => {"changed": false, "msg": "Failed to update apt cache: W:Updating from such a repository can't be done securely, and is therefore disabled by default., W:See apt-secure(8) manpage for repository creation and user configuration details., E:The repository 'http://cdn-aws.deb.debian.org/debian buster-backports Release' does not have a Release file."} As suggested by [1], work around that issue by patching the repository URL so to use debian archives instead. [1] cyberciti.biz/faq/the-repository-http-deb-debian-org-debian-buster-backports-release-no-longer-has-a-release-file --- molecule/resources/playbooks/prepare.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/molecule/resources/playbooks/prepare.yml b/molecule/resources/playbooks/prepare.yml index f1dea7a5c..3619390fd 100644 --- a/molecule/resources/playbooks/prepare.yml +++ b/molecule/resources/playbooks/prepare.yml @@ -12,6 +12,13 @@ - name: Prepare Debian hosts block: + - name: Work around buster-backports (debian 10) + ansible.builtin.replace: + path: /etc/apt/sources.list + regexp: '(^.*http://).*(\.debian\.org.*buster-backports.*$)' + replace: '\1archive\2' + when: ansible_distribution_major_version == "10" + - name: Update apt cache ansible.builtin.apt: update_cache: true