Files
cloud-docker/tasks/main.yml
T
lhahnandClaude Opus 5.5 07e3ca8ed0 Use the docker compose plugin instead of a standalone binary
- install docker-compose-plugin from the docker repo and remove /usr/local/bin/docker-compose (pinned 2.29.0)
- remove the legacy download_docker_com_linux_debian.list (no signed-by), which made apt refuse the docker sources

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 17:47:27 +02:00

63 lines
1.7 KiB
YAML
Executable File

---
# Basics
- name: install requirements for docker
apt:
update_cache: yes
state: "{% if cloud_update | bool %}latest{% else %}present{% endif %}"
install_recommends: yes
pkg:
- apt-transport-https
- ca-certificates
- gnupg2
- curl
# Docker
- name: Create apt keyrings directory
file:
path: /etc/apt/keyrings
state: directory
mode: '0755'
- name: Download Docker GPG key
get_url:
url: https://download.docker.com/linux/debian/gpg
dest: /etc/apt/keyrings/docker.asc
mode: '0644'
# older versions of this role created this file without signed-by; apt
# refuses two docker sources with different Signed-By values
- name: remove legacy docker repository file
file:
path: /etc/apt/sources.list.d/download_docker_com_linux_debian.list
state: absent
# write the whole file so repo lines of older releases do not linger
- name: Add Docker repository
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:
update_cache: yes
- name: install docker (docker-ce + docker-ce-cli)
apt:
update_cache: yes
state: "{% if cloud_update | bool %}latest{% else %}present{% endif %}"
install_recommends: yes
pkg:
- docker-ce
- docker-ce-cli
- docker-compose-plugin
- python3-docker
# Docker Compose: use the "docker compose" plugin from the docker repo
- name: remove standalone docker-compose binary
file:
path: /usr/local/bin/docker-compose
state: absent