Add Docker's apt repo with a signed-by key, ready for Debian 13

Debian 13 drops apt-key and software-properties-common, so the old tasks
would fail after the upgrade. The key now lives in /etc/apt/keyrings
(same fingerprint, 9DC8...CD88), the repo is a deb822 file whose release
name follows the installed Debian, and the old .list file is removed.
The apt tasks get a docker_apt tag so they can be deployed on their own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Phil
2026-10-31 17:52:02 -06:00
co-authored by Claude Opus 5.5
parent 5f1d7635e9
commit 2acf307ac0
+27 -9
View File
@@ -4,7 +4,6 @@
- apt-transport-https
- ca-certificates
- curl
- software-properties-common
- python3-pip
- virtualenv
- python3-setuptools
@@ -15,21 +14,40 @@
- name: setup shell
import_tasks: shell.yml
- name: Add Docker GPG apt Key
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
# Docker's repo, signed by its own key file. The release name comes from the
# installed Debian, so this keeps working across upgrades. (Debian 13 has no
# apt-key, so the key can't go in the shared trusted.gpg any more.)
- name: Download Docker's apt key
ansible.builtin.get_url:
url: https://download.docker.com/linux/debian/gpg
dest: /etc/apt/keyrings/docker.asc
owner: root
mode: '0644'
tags: docker_apt
- name: Add Docker Repository
apt_repository:
repo: deb https://download.docker.com/linux/debian bookworm stable
state: present
- name: Add Docker's apt repository
ansible.builtin.deb822_repository:
name: docker
types: deb
uris: https://download.docker.com/linux/debian
suites: "{{ ansible_distribution_release }}"
components: stable
signed_by: /etc/apt/keyrings/docker.asc
tags: docker_apt
# Written by the old apt_repository task; docker.sources replaces it.
- name: Remove the old Docker repo list
ansible.builtin.file:
path: /etc/apt/sources.list.d/download_docker_com_linux_debian.list
state: absent
tags: docker_apt
- name: Update apt and install docker-ce
apt:
name: docker-ce
state: latest
update_cache: true
tags: docker_apt
- name: copy over ufw-docker.sh
ansible.builtin.copy: