From dca5cb53609ec754b1f40f5c58e4fb326abe7605 Mon Sep 17 00:00:00 2001 From: lhahn Date: Wed, 14 Oct 2026 17:37:16 +0200 Subject: [PATCH] Write docker.list as a single line apt_repository only adds lines, so the repo line of the previous Debian release stayed in the file after a dist upgrade. Co-Authored-By: Claude Opus 5.5 --- tasks/main.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 6ffbd58..f1cba72 100755 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -24,11 +24,14 @@ dest: /etc/apt/keyrings/docker.asc mode: '0644' +# write the whole file so repo lines of older releases do not linger - name: Add Docker repository - apt_repository: - repo: "deb [arch={{ docker_apt_arch[ansible_architecture] | default(ansible_architecture) }} signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian {{ ansible_distribution_release }} stable" - state: present - filename: docker + copy: + dest: /etc/apt/sources.list.d/docker.list + content: "deb [arch={{ docker_apt_arch[ansible_architecture] | default(ansible_architecture) }} signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian {{ ansible_distribution_release }} stable\n" + owner: root + group: root + mode: "0644" - name: Update apt cache apt: