docker-ansi
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 2s

This commit is contained in:
hogweed1
2026-05-16 00:41:05 +10:00
parent 16c99a47eb
commit 05b7decce3
3 changed files with 61 additions and 8 deletions

View File

@@ -38,16 +38,21 @@ vms:
children:
printer:
kubernetes:
docker:
docker_vms:
docker:
children:
docker_vms:
hosts:
# swarm-node1.guaranteedstruggle.host:
# swarm-node2.guaranteedstruggle.host:
# swarm-node3.guaranteedstruggle.host:
harbor.guaranteedstruggle.host:
docker_lxc:
hosts:
nexus.guaranteedstruggle.host:
kubernetes:
hosts:
@@ -100,3 +105,5 @@ lxc:
#gpu-slut.guaranteedstruggle.host:
root-ca.guaranteedstruggle.host:
children:
docker_lxc:

View File

@@ -20,6 +20,7 @@
- jq
- rsync
- unzip
- ca-certificates
#state: latest
state: present

View File

@@ -0,0 +1,45 @@
---
- name: Migrate Docker repository to modern DEB822 standard
hosts: docker
become: true
tasks:
# 1. Зачищаем старые следы (legacy-дефолт)
- name: Remove legacy Docker apt source list if exists
ansible.builtin.file:
path: /etc/apt/sources.list.d/docker.list
state: absent
- name: Remove legacy Docker GPG key from trusted.gpg.d
ansible.builtin.file:
path: /etc/apt/trusted.gpg.d/docker.gpg
state: absent
# 2. Разворачиваем репозиторий по "актуальной мете"
- name: Setup Docker CE repository using deb822 format
ansible.builtin.deb822_repository:
name: docker
types: deb
uris: https://download.docker.com/linux/debian
# ansible_distribution_release автоматически подставит имя дистрибутива (например, bookworm или trixie)
suites: "{{ ansible_distribution_release }}"
components: stable
# Ansible сам скачает текстовый ключ, дебронирует его в бинарный
# и сохранит по канону в /etc/apt/keyrings/docker.gpg
signed_by: https://download.docker.com/linux/debian/gpg
register: docker_repo_added
# 3. Обновляем кэш пакетов только при изменениях
- name: Run apt update
ansible.builtin.apt:
update_cache: true
when: docker_repo_added.changed
- name: Install the packages versions
ansible.builtin.package:
name:
- docker-ce
- docker-ce-cli
- containerd.io
- docker-buildx-plugin
- docker-compose-plugin