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:
@@ -4,7 +4,6 @@
|
|||||||
- apt-transport-https
|
- apt-transport-https
|
||||||
- ca-certificates
|
- ca-certificates
|
||||||
- curl
|
- curl
|
||||||
- software-properties-common
|
|
||||||
- python3-pip
|
- python3-pip
|
||||||
- virtualenv
|
- virtualenv
|
||||||
- python3-setuptools
|
- python3-setuptools
|
||||||
@@ -15,21 +14,40 @@
|
|||||||
- name: setup shell
|
- name: setup shell
|
||||||
import_tasks: shell.yml
|
import_tasks: shell.yml
|
||||||
|
|
||||||
- name: Add Docker GPG apt Key
|
# Docker's repo, signed by its own key file. The release name comes from the
|
||||||
apt_key:
|
# installed Debian, so this keeps working across upgrades. (Debian 13 has no
|
||||||
url: https://download.docker.com/linux/ubuntu/gpg
|
# apt-key, so the key can't go in the shared trusted.gpg any more.)
|
||||||
state: present
|
- 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
|
- name: Add Docker's apt repository
|
||||||
apt_repository:
|
ansible.builtin.deb822_repository:
|
||||||
repo: deb https://download.docker.com/linux/debian bookworm stable
|
name: docker
|
||||||
state: present
|
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
|
- name: Update apt and install docker-ce
|
||||||
apt:
|
apt:
|
||||||
name: docker-ce
|
name: docker-ce
|
||||||
state: latest
|
state: latest
|
||||||
update_cache: true
|
update_cache: true
|
||||||
|
tags: docker_apt
|
||||||
|
|
||||||
- name: copy over ufw-docker.sh
|
- name: copy over ufw-docker.sh
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
|
|||||||
Reference in New Issue
Block a user