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 <noreply@anthropic.com>
This commit is contained in:
lhahnandClaude Opus 5.5 committed 2026-10-14 17:37:16 +02:00
1 parent ebe85e2989
commit dca5cb5360
1 file changed
+7 -4
+7 -4
View File
@@ -24,11 +24,14 @@
dest: /etc/apt/keyrings/docker.asc dest: /etc/apt/keyrings/docker.asc
mode: '0644' mode: '0644'
# write the whole file so repo lines of older releases do not linger
- name: Add Docker repository - name: Add Docker repository
apt_repository: copy:
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" dest: /etc/apt/sources.list.d/docker.list
state: present 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"
filename: docker owner: root
group: root
mode: "0644"
- name: Update apt cache - name: Update apt cache
apt: apt: