This commit is contained in:
2026-02-23 21:47:35 +01:00
parent 0eb5c15d2b
commit 6fa22fc99f

View File

@@ -54,16 +54,32 @@
- software-properties-common
state: present
- name: Add Docker GPG key for containerd
ansible.builtin.apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
keyring: /etc/apt/trusted.gpg.d/containerd.gpg
state: present
- name: Remove old Docker repository files (if any)
file:
path: "{{ item }}"
state: absent
loop:
- /etc/apt/sources.list.d/docker.list
- /etc/apt/keyrings/docker.gpg
- /etc/apt/trusted.gpg.d/containerd.gpg
- name: Add Docker repository
ansible.builtin.apt_repository:
repo: "deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_lsb.codename }} stable"
- name: Create keyrings directory
file:
path: /etc/apt/keyrings
state: directory
mode: '0755'
- name: Download Docker GPG key
get_url:
url: https://download.docker.com/linux/ubuntu/gpg
dest: /etc/apt/keyrings/docker.gpg
mode: '0644'
- name: Add Docker repository (Ubuntu 24.04 safe)
apt_repository:
repo: "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu {{ ansible_lsb.codename }} stable"
state: present
filename: docker
- name: Install required packages