From e638f7cc94b6bf2f3728381d19bc9e074e9a46b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B9=20=D0=90=D0=BD=D1=82?= =?UTF-8?q?=D1=80=D0=BE=D0=BF=D0=BE=D0=B2?= Date: Sat, 25 Oct 2025 23:25:20 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B=20=D0=BD=D0=BE=D0=B2=D1=8B=D0=B5=20=D0=B2=D0=B5?= =?UTF-8?q?=D1=80=D1=81=D0=B8=D0=B8=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B7=D0=BE?= =?UTF-8?q?=D0=B2=20=D0=B2=20docker-get-base-tag:=20centos7/8/9,=20ubuntu2?= =?UTF-8?q?0/22/24,=20debian9/10/11/12?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 41 ++++++++++++++++++++++++++++--- molecule/presets/default.yml | 17 +++++++++---- molecule/presets/docker-full.yml | 6 ++--- molecule/presets/docker-test.yml | 4 +-- molecule/presets/etcd-patroni.yml | 10 ++++---- molecule/presets/multi-os.yml | 12 ++++----- molecule/presets/performance.yml | 12 ++++----- molecule/presets/security.yml | 12 ++++----- molecule/presets/stable.yml | 4 +-- molecule/presets/standart.yml | 4 +-- molecule/presets/test.yml | 2 +- 11 files changed, 83 insertions(+), 41 deletions(-) diff --git a/Makefile b/Makefile index 8ffa01b..027c18e 100644 --- a/Makefile +++ b/Makefile @@ -842,7 +842,17 @@ docker-get-base-tag: echo "📦 Загрузка базового образа $$BASE_IMAGE..." >&2; \ docker pull $$BASE_IMAGE >/dev/null 2>&1 || echo "⚠️ Не удалось загрузить $$BASE_IMAGE" >&2; \ TAG=$$(docker inspect --format='{{.RepoTags}}' $$BASE_IMAGE 2>/dev/null | tr -d '[]' | cut -d',' -f1 | cut -d':' -f2 | tr -d ' ' || echo "latest");; \ - centos) \ + centos7) \ + BASE_IMAGE="centos:7"; \ + echo "📦 Загрузка базового образа $$BASE_IMAGE..." >&2; \ + docker pull $$BASE_IMAGE >/dev/null 2>&1 || echo "⚠️ Не удалось загрузить $$BASE_IMAGE" >&2; \ + TAG=$$(docker inspect --format='{{.RepoTags}}' $$BASE_IMAGE 2>/dev/null | tr -d '[]' | cut -d',' -f1 | cut -d':' -f2 | tr -d ' ' || echo "latest");; \ + centos8) \ + BASE_IMAGE="quay.io/centos/centos:8"; \ + echo "📦 Загрузка базового образа $$BASE_IMAGE..." >&2; \ + docker pull $$BASE_IMAGE >/dev/null 2>&1 || echo "⚠️ Не удалось загрузить $$BASE_IMAGE" >&2; \ + TAG=$$(docker inspect --format='{{.RepoTags}}' $$BASE_IMAGE 2>/dev/null | tr -d '[]' | cut -d',' -f1 | cut -d':' -f2 | tr -d ' ' || echo "latest");; \ + centos9) \ BASE_IMAGE="quay.io/centos/centos:stream9"; \ echo "📦 Загрузка базового образа $$BASE_IMAGE..." >&2; \ docker pull $$BASE_IMAGE >/dev/null 2>&1 || echo "⚠️ Не удалось загрузить $$BASE_IMAGE" >&2; \ @@ -857,12 +867,37 @@ docker-get-base-tag: echo "📦 Загрузка базового образа $$BASE_IMAGE..." >&2; \ docker pull $$BASE_IMAGE >/dev/null 2>&1 || echo "⚠️ Не удалось загрузить $$BASE_IMAGE" >&2; \ TAG=$$(docker inspect --format='{{.RepoTags}}' $$BASE_IMAGE 2>/dev/null | tr -d '[]' | cut -d',' -f1 | cut -d':' -f2 | tr -d ' ' || echo "latest");; \ - ubuntu) \ + ubuntu20) \ + BASE_IMAGE="ubuntu:20.04"; \ + echo "📦 Загрузка базового образа $$BASE_IMAGE..." >&2; \ + docker pull $$BASE_IMAGE >/dev/null 2>&1 || echo "⚠️ Не удалось загрузить $$BASE_IMAGE" >&2; \ + TAG=$$(docker inspect --format='{{.RepoTags}}' $$BASE_IMAGE 2>/dev/null | tr -d '[]' | cut -d',' -f1 | cut -d':' -f2 | tr -d ' ' || echo "latest");; \ + ubuntu22) \ BASE_IMAGE="ubuntu:22.04"; \ echo "📦 Загрузка базового образа $$BASE_IMAGE..." >&2; \ docker pull $$BASE_IMAGE >/dev/null 2>&1 || echo "⚠️ Не удалось загрузить $$BASE_IMAGE" >&2; \ TAG=$$(docker inspect --format='{{.RepoTags}}' $$BASE_IMAGE 2>/dev/null | tr -d '[]' | cut -d',' -f1 | cut -d':' -f2 | tr -d ' ' || echo "latest");; \ - debian) \ + ubuntu24) \ + BASE_IMAGE="ubuntu:24.04"; \ + echo "📦 Загрузка базового образа $$BASE_IMAGE..." >&2; \ + docker pull $$BASE_IMAGE >/dev/null 2>&1 || echo "⚠️ Не удалось загрузить $$BASE_IMAGE" >&2; \ + TAG=$$(docker inspect --format='{{.RepoTags}}' $$BASE_IMAGE 2>/dev/null | tr -d '[]' | cut -d',' -f1 | cut -d':' -f2 | tr -d ' ' || echo "latest");; \ + debian9) \ + BASE_IMAGE="debian:9"; \ + echo "📦 Загрузка базового образа $$BASE_IMAGE..." >&2; \ + docker pull $$BASE_IMAGE >/dev/null 2>&1 || echo "⚠️ Не удалось загрузить $$BASE_IMAGE" >&2; \ + TAG=$$(docker inspect --format='{{.RepoTags}}' $$BASE_IMAGE 2>/dev/null | tr -d '[]' | cut -d',' -f1 | cut -d':' -f2 | tr -d ' ' || echo "latest");; \ + debian10) \ + BASE_IMAGE="debian:10"; \ + echo "📦 Загрузка базового образа $$BASE_IMAGE..." >&2; \ + docker pull $$BASE_IMAGE >/dev/null 2>&1 || echo "⚠️ Не удалось загрузить $$BASE_IMAGE" >&2; \ + TAG=$$(docker inspect --format='{{.RepoTags}}' $$BASE_IMAGE 2>/dev/null | tr -d '[]' | cut -d',' -f1 | cut -d':' -f2 | tr -d ' ' || echo "latest");; \ + debian11) \ + BASE_IMAGE="debian:11"; \ + echo "📦 Загрузка базового образа $$BASE_IMAGE..." >&2; \ + docker pull $$BASE_IMAGE >/dev/null 2>&1 || echo "⚠️ Не удалось загрузить $$BASE_IMAGE" >&2; \ + TAG=$$(docker inspect --format='{{.RepoTags}}' $$BASE_IMAGE 2>/dev/null | tr -d '[]' | cut -d',' -f1 | cut -d':' -f2 | tr -d ' ' || echo "latest");; \ + debian12) \ BASE_IMAGE="debian:bookworm"; \ echo "📦 Загрузка базового образа $$BASE_IMAGE..." >&2; \ docker pull $$BASE_IMAGE >/dev/null 2>&1 || echo "⚠️ Не удалось загрузить $$BASE_IMAGE" >&2; \ diff --git a/molecule/presets/default.yml b/molecule/presets/default.yml index 3362234..66bb22b 100644 --- a/molecule/presets/default.yml +++ b/molecule/presets/default.yml @@ -11,12 +11,19 @@ images: alt: "inecs/ansible-lab:alt-linux-latest" astra: "inecs/ansible-lab:astra-linux-latest" rhel: "inecs/ansible-lab:rhel-latest" - centos: "inecs/ansible-lab:centos-latest" + centos7: "inecs/ansible-lab:centos7-latest" + centos8: "inecs/ansible-lab:centos8-latest" + centos9: "inecs/ansible-lab:centos9-latest" alma: "inecs/ansible-lab:alma-latest" rocky: "inecs/ansible-lab:rocky-latest" redos: "inecs/ansible-lab:redos-latest" - ubuntu: "inecs/ansible-lab:ubuntu-latest" - debian: "inecs/ansible-lab:debian-latest" + ubuntu20: "inecs/ansible-lab:ubuntu20-latest" + ubuntu22: "inecs/ansible-lab:ubuntu22-latest" + ubuntu24: "inecs/ansible-lab:ubuntu24-latest" + debian9: "inecs/ansible-lab:debian9-latest" + debian10: "inecs/ansible-lab:debian10-latest" + debian11: "inecs/ansible-lab:debian11-latest" + debian12: "inecs/ansible-lab:debian12-latest" systemd_defaults: privileged: true @@ -29,8 +36,8 @@ systemd_defaults: hosts: # Стандартный набор - 2 хоста для базового тестирования (стабильные ОС) - name: u1 - family: ubuntu + family: ubuntu22 groups: [test, web] - name: u2 - family: debian + family: debian12 groups: [test, web] \ No newline at end of file diff --git a/molecule/presets/docker-full.yml b/molecule/presets/docker-full.yml index 01a5a5e..64d91c5 100644 --- a/molecule/presets/docker-full.yml +++ b/molecule/presets/docker-full.yml @@ -29,10 +29,10 @@ systemd_defaults: hosts: # Базовые хосты (стабильные ОС) - name: u1 - family: ubuntu + family: ubuntu22 groups: [test, web] - name: u2 - family: debian + family: debian12 groups: [test, web] # DinD узел (Docker-in-Docker) @@ -44,7 +44,7 @@ hosts: # DOoD узел (Docker-out-of-Docker) - name: dood1 type: dood - family: ubuntu + family: ubuntu22 groups: [dood] publish: ["8081:8081"] env: diff --git a/molecule/presets/docker-test.yml b/molecule/presets/docker-test.yml index 9a605a9..755b195 100644 --- a/molecule/presets/docker-test.yml +++ b/molecule/presets/docker-test.yml @@ -29,7 +29,7 @@ systemd_defaults: hosts: # Тестовые хосты - name: test1 - family: debian + family: debian12 groups: [test] - name: test2 family: rhel @@ -44,7 +44,7 @@ hosts: # DOoD узел (Docker-out-of-Docker) - name: dood1 type: dood - family: debian + family: debian12 groups: [dood] publish: ["8081:8081"] env: diff --git a/molecule/presets/etcd-patroni.yml b/molecule/presets/etcd-patroni.yml index 7e64a1a..a7cb806 100644 --- a/molecule/presets/etcd-patroni.yml +++ b/molecule/presets/etcd-patroni.yml @@ -30,19 +30,19 @@ systemd_defaults: hosts: # ETCD кластер (5 узлов для высокой доступности) - name: etcd1 - family: debian + family: debian12 groups: [etcd, cluster] - name: etcd2 family: rhel groups: [etcd, cluster] - name: etcd3 - family: debian + family: debian12 groups: [etcd, cluster] - name: etcd4 family: rhel groups: [etcd, cluster] - name: etcd5 - family: debian + family: debian12 groups: [etcd, cluster] # Patroni кластер (3 узла PostgreSQL) @@ -50,7 +50,7 @@ hosts: family: rhel groups: [patroni, database, cluster] - name: patroni2 - family: debian + family: debian12 groups: [patroni, database, cluster] - name: patroni3 family: rhel @@ -58,7 +58,7 @@ hosts: # HAProxy для балансировки - name: haproxy - family: debian + family: debian12 groups: [haproxy, loadbalancer] publish: ["5000:5000", "5001:5001"] # RW и RO порты diff --git a/molecule/presets/multi-os.yml b/molecule/presets/multi-os.yml index 0be2b1e..dba0687 100644 --- a/molecule/presets/multi-os.yml +++ b/molecule/presets/multi-os.yml @@ -30,16 +30,16 @@ systemd_defaults: hosts: # Debian серверы - name: debian1 - family: debian + family: debian12 groups: [debian, servers, web] - name: debian2 - family: debian + family: debian12 groups: [debian, servers, web] - name: debian3 - family: debian + family: debian12 groups: [debian, servers, app] - name: debian4 - family: debian + family: debian12 groups: [debian, servers, app] # RHEL серверы @@ -58,7 +58,7 @@ hosts: # База данных на разных ОС - name: db-debian - family: debian + family: debian12 groups: [database, debian, db] - name: db-rhel family: rhel @@ -66,7 +66,7 @@ hosts: # Load balancer - name: lb-mixed - family: debian + family: debian12 groups: [loadbalancer, haproxy] publish: ["80:80", "443:443"] diff --git a/molecule/presets/performance.yml b/molecule/presets/performance.yml index 79babf3..3c3bf4d 100644 --- a/molecule/presets/performance.yml +++ b/molecule/presets/performance.yml @@ -30,19 +30,19 @@ systemd_defaults: hosts: # Основные серверы (5 узлов) - name: server1 - family: debian + family: debian12 groups: [servers, web, app] - name: server2 family: rhel groups: [servers, web, app] - name: server3 - family: debian + family: debian12 groups: [servers, web, app] - name: server4 family: rhel groups: [servers, web, app] - name: server5 - family: debian + family: debian12 groups: [servers, web, app] # База данных (3 узла) @@ -50,7 +50,7 @@ hosts: family: rhel groups: [database, db] - name: db2 - family: debian + family: debian12 groups: [database, db] - name: db3 family: rhel @@ -58,13 +58,13 @@ hosts: # Кэш (3 узла Redis) - name: cache1 - family: debian + family: debian12 groups: [cache, redis] - name: cache2 family: rhel groups: [cache, redis] - name: cache3 - family: debian + family: debian12 groups: [cache, redis] # Load balancer diff --git a/molecule/presets/security.yml b/molecule/presets/security.yml index 098da20..fb65f3b 100644 --- a/molecule/presets/security.yml +++ b/molecule/presets/security.yml @@ -34,7 +34,7 @@ hosts: groups: [bastion, security, jump] publish: ["2222:22"] - name: bastion2 - family: debian + family: debian12 groups: [bastion, security, jump] publish: ["2223:22"] @@ -43,7 +43,7 @@ hosts: family: rhel groups: [internal, servers, app] - name: internal2 - family: debian + family: debian12 groups: [internal, servers, app] - name: internal3 family: rhel @@ -54,12 +54,12 @@ hosts: family: rhel groups: [database, secure, internal] - name: db-secure2 - family: debian + family: debian12 groups: [database, secure, internal] # Мониторинг и логирование - name: monitor1 - family: debian + family: debian12 groups: [monitoring, security, logs] - name: monitor2 family: rhel @@ -70,13 +70,13 @@ hosts: family: rhel groups: [firewall, network, security] - name: fw2 - family: debian + family: debian12 groups: [firewall, network, security] # DOoD узел для тестирования Docker безопасности - name: docker-secure type: dood - family: debian + family: debian12 groups: [docker, security, apps] publish: ["8080:8080"] env: diff --git a/molecule/presets/stable.yml b/molecule/presets/stable.yml index 5636631..953896b 100644 --- a/molecule/presets/stable.yml +++ b/molecule/presets/stable.yml @@ -29,8 +29,8 @@ systemd_defaults: hosts: # Стабильные ОС для надежного тестирования - name: u1 - family: ubuntu + family: ubuntu22 groups: [test, web] - name: u2 - family: debian + family: debian12 groups: [test, web] diff --git a/molecule/presets/standart.yml b/molecule/presets/standart.yml index d9807a5..e83060b 100644 --- a/molecule/presets/standart.yml +++ b/molecule/presets/standart.yml @@ -29,11 +29,11 @@ systemd_defaults: hosts: # Стандартный набор - 3 хоста - name: u1 - family: debian + family: debian12 groups: [test] - name: u2 family: rhel groups: [test] - name: u3 - family: debian + family: debian12 groups: [test] diff --git a/molecule/presets/test.yml b/molecule/presets/test.yml index f1f376b..d00f877 100644 --- a/molecule/presets/test.yml +++ b/molecule/presets/test.yml @@ -29,5 +29,5 @@ systemd_defaults: hosts: # Минимальный набор - один хост - name: u1 - family: debian + family: debian12 groups: [test]