docker-ansi
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 2s
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 2s
This commit is contained in:
@@ -38,16 +38,21 @@ vms:
|
|||||||
children:
|
children:
|
||||||
printer:
|
printer:
|
||||||
kubernetes:
|
kubernetes:
|
||||||
docker:
|
docker_vms:
|
||||||
|
|
||||||
|
|
||||||
docker:
|
docker:
|
||||||
hosts:
|
children:
|
||||||
# swarm-node1.guaranteedstruggle.host:
|
docker_vms:
|
||||||
# swarm-node2.guaranteedstruggle.host:
|
hosts:
|
||||||
# swarm-node3.guaranteedstruggle.host:
|
# swarm-node1.guaranteedstruggle.host:
|
||||||
|
# swarm-node2.guaranteedstruggle.host:
|
||||||
|
# swarm-node3.guaranteedstruggle.host:
|
||||||
|
harbor.guaranteedstruggle.host:
|
||||||
|
docker_lxc:
|
||||||
|
hosts:
|
||||||
|
nexus.guaranteedstruggle.host:
|
||||||
|
|
||||||
harbor.guaranteedstruggle.host:
|
|
||||||
|
|
||||||
kubernetes:
|
kubernetes:
|
||||||
hosts:
|
hosts:
|
||||||
@@ -69,7 +74,7 @@ printer:
|
|||||||
|
|
||||||
#### TODO
|
#### TODO
|
||||||
lxc:
|
lxc:
|
||||||
hosts:
|
hosts:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -100,3 +105,5 @@ lxc:
|
|||||||
|
|
||||||
#gpu-slut.guaranteedstruggle.host:
|
#gpu-slut.guaranteedstruggle.host:
|
||||||
root-ca.guaranteedstruggle.host:
|
root-ca.guaranteedstruggle.host:
|
||||||
|
children:
|
||||||
|
docker_lxc:
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
- jq
|
- jq
|
||||||
- rsync
|
- rsync
|
||||||
- unzip
|
- unzip
|
||||||
|
- ca-certificates
|
||||||
|
|
||||||
#state: latest
|
#state: latest
|
||||||
state: present
|
state: present
|
||||||
|
|||||||
45
playbooks/software/docker.yml
Normal file
45
playbooks/software/docker.yml
Normal 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
|
||||||
Reference in New Issue
Block a user