From 30aa6a722f2e71d3bef8c62370600cf9e394f1fd 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 16:13:39 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B7=20=D0=BA=D0=BE=D0=BD?= =?UTF-8?q?=D1=82=D1=80=D0=BE=D0=BB=D0=BB=D0=B5=D1=80=D0=B0=20=D0=B2=20Mak?= =?UTF-8?q?efile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Изменена переменная DOCKER_IMAGE на inecs/ansible-lab:ansible-controller-latest - Обновлена команда сборки контроллера для использования нового формата тегов - Обновлен docker-compose.yml для использования готового образа - Обновлена справка с новым именем образа - Добавлены ubuntu и debian в список собираемых образов - Теперь контроллер использует единый формат тегов с остальными образами Автор: Сергей Антропов Сайт: https://devops.org.ru --- Makefile | 11 ++++++----- .../ansible-controller/docker-compose.yml | 4 +--- molecule/presets/default.yml | 18 +++++++++++++++--- molecule/presets/docker-test.yml | 3 +-- molecule/presets/etcd-patroni.yml | 3 +-- molecule/presets/minimal.yml | 3 +-- molecule/presets/multi-os.yml | 3 +-- molecule/presets/performance.yml | 3 +-- molecule/presets/security.yml | 3 +-- molecule/presets/standart.yml | 3 +-- molecule/presets/test.yml | 3 +-- 11 files changed, 30 insertions(+), 27 deletions(-) diff --git a/Makefile b/Makefile index b7038b4..c031e62 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,7 @@ PROJECT_NAME ?= ansible-template VERSION ?= 0.1.0 AUTHOR ?= "Сергей Антропов" SITE ?= "https://devops.org.ru" -DOCKER_IMAGE ?= inecs/ansible-controller:latest +DOCKER_IMAGE ?= inecs/ansible-lab:ansible-controller-latest DOCKER_DIND_IMAGE ?= docker:27-dind CONTAINER_NAME ?= ansible-controller @@ -516,7 +516,7 @@ docker: echo ""; \ echo " 🐳 make docker build - собрать все Docker образы (multi-arch)"; \ echo " 💡 Собирает: ansible-controller, alt-linux, astra-linux, redos"; \ - echo " 💡 Собирает: rhel, centos, alma, rocky"; \ + echo " 💡 Собирает: rhel, centos, alma, rocky, ubuntu, debian"; \ echo " 💡 Платформы: $(DOCKER_PLATFORMS)"; \ echo " 💡 Тегирует: inecs/образ: (автоматически извлекает теги)"; \ echo " 💡 Отправляет: автоматически в Docker Hub"; \ @@ -570,7 +570,7 @@ docker: echo ""; \ echo " 🐳 make docker build - собрать все Docker образы (multi-arch)"; \ echo " 💡 Собирает: ansible-controller, alt-linux, astra-linux, redos"; \ - echo " 💡 Собирает: rhel, centos, alma, rocky"; \ + echo " 💡 Собирает: rhel, centos, alma, rocky, ubuntu, debian"; \ echo " 💡 Платформы: $(DOCKER_PLATFORMS)"; \ echo " 💡 Тегирует: inecs/образ: (автоматически извлекает теги)"; \ echo " 💡 Отправляет: автоматически в Docker Hub"; \ @@ -817,7 +817,8 @@ controller: cd dockerfiles/ansible-controller && \ docker buildx build \ --platform $(DOCKER_PLATFORMS) \ - --tag $(DOCKER_REGISTRY)/ansible-controller:$(DOCKER_VERSION) \ + --tag $(DOCKER_REGISTRY):ansible-controller-$(DOCKER_VERSION) \ + --tag $(DOCKER_REGISTRY):ansible-controller-latest \ --push \ .; \ echo "✅ ansible-controller собран и отправлен";; \ @@ -833,7 +834,7 @@ controller: echo "🎯 Доступные команды:"; \ echo ""; \ echo " 🔨 make controller build - собрать ansible-controller (multi-arch)"; \ - echo " 💡 Собирает: inecs/ansible-controller:latest"; \ + echo " 💡 Собирает: inecs/ansible-lab:ansible-controller-latest"; \ echo " 💡 Платформы: $(DOCKER_PLATFORMS)"; \ echo " 💡 Использует: dockerfiles/ansible-controller/Dockerfile"; \ echo " 💡 Requirements: dockerfiles/ansible-controller/requirements.yml"; \ diff --git a/dockerfiles/ansible-controller/docker-compose.yml b/dockerfiles/ansible-controller/docker-compose.yml index 6e6f3af..618b7bf 100644 --- a/dockerfiles/ansible-controller/docker-compose.yml +++ b/dockerfiles/ansible-controller/docker-compose.yml @@ -2,9 +2,7 @@ version: "3.9" services: ansible-controller: - build: - context: . - dockerfile: Dockerfile + image: inecs/ansible-lab:ansible-controller-latest container_name: ansible-controller privileged: true command: sleep infinity diff --git a/molecule/presets/default.yml b/molecule/presets/default.yml index 7efa724..3716f8b 100644 --- a/molecule/presets/default.yml +++ b/molecule/presets/default.yml @@ -8,8 +8,6 @@ generated_inventory: "{{ molecule_ephemeral_directory }}/inventory/hosts.ini" # systemd-ready образы images: - debian: "ghcr.io/ansible-community/molecule-ubuntu-systemd:jammy" - # Собственные образы AnsibleTemplate alt: "inecs/ansible-lab:alt-linux-latest" astra: "inecs/ansible-lab:astra-linux-latest" rhel: "inecs/ansible-lab:rhel-latest" @@ -18,7 +16,6 @@ images: rocky: "inecs/ansible-lab:rocky-latest" redos: "inecs/ansible-lab:redos-latest" ubuntu: "inecs/ansible-lab:ubuntu-latest" - debian: "inecs/ansible-lab:debian-latest" ubuntu: "inecs/ansible-lab:ubuntu-latest" debian: "inecs/ansible-lab:debian-latest" systemd_defaults: @@ -37,3 +34,18 @@ hosts: - name: u2 family: rhel groups: [test, web] + + # DinD узел (Docker-in-Docker) + - name: docker1 + type: dind + groups: [docker] + publish: ["8080:8080"] + + # DOoD узел (Docker-out-of-Docker) + - name: dood1 + type: dood + family: debian + groups: [dood] + publish: ["8081:8081"] + env: + DOCKER_HOST: unix:///var/run/docker.sock \ No newline at end of file diff --git a/molecule/presets/docker-test.yml b/molecule/presets/docker-test.yml index aa72161..b3052be 100644 --- a/molecule/presets/docker-test.yml +++ b/molecule/presets/docker-test.yml @@ -8,8 +8,6 @@ generated_inventory: "{{ molecule_ephemeral_directory }}/inventory/hosts.ini" # systemd-ready образы images: - debian: "ghcr.io/ansible-community/molecule-ubuntu-systemd:jammy" - # Собственные образы AnsibleTemplate alt: "inecs/ansible-lab:alt-linux-latest" astra: "inecs/ansible-lab:astra-linux-latest" rhel: "inecs/ansible-lab:rhel-latest" @@ -19,6 +17,7 @@ images: redos: "inecs/ansible-lab:redos-latest" ubuntu: "inecs/ansible-lab:ubuntu-latest" debian: "inecs/ansible-lab:debian-latest" + systemd_defaults: privileged: true command: "/sbin/init" diff --git a/molecule/presets/etcd-patroni.yml b/molecule/presets/etcd-patroni.yml index f6f7173..5519100 100644 --- a/molecule/presets/etcd-patroni.yml +++ b/molecule/presets/etcd-patroni.yml @@ -8,8 +8,6 @@ generated_inventory: "{{ molecule_ephemeral_directory }}/inventory/hosts.ini" # systemd-ready образы images: - debian: "ghcr.io/ansible-community/molecule-ubuntu-systemd:jammy" - # Собственные образы AnsibleTemplate alt: "inecs/ansible-lab:alt-linux-latest" astra: "inecs/ansible-lab:astra-linux-latest" rhel: "inecs/ansible-lab:rhel-latest" @@ -19,6 +17,7 @@ images: redos: "inecs/ansible-lab:redos-latest" ubuntu: "inecs/ansible-lab:ubuntu-latest" debian: "inecs/ansible-lab:debian-latest" + systemd_defaults: privileged: true command: "/sbin/init" diff --git a/molecule/presets/minimal.yml b/molecule/presets/minimal.yml index db23d30..db39883 100644 --- a/molecule/presets/minimal.yml +++ b/molecule/presets/minimal.yml @@ -8,8 +8,6 @@ generated_inventory: "{{ molecule_ephemeral_directory }}/inventory/hosts.ini" # systemd-ready образы images: - debian: "ghcr.io/ansible-community/molecule-ubuntu-systemd:jammy" - # Собственные образы AnsibleTemplate alt: "inecs/ansible-lab:alt-linux-latest" astra: "inecs/ansible-lab:astra-linux-latest" rhel: "inecs/ansible-lab:rhel-latest" @@ -19,6 +17,7 @@ images: redos: "inecs/ansible-lab:redos-latest" ubuntu: "inecs/ansible-lab:ubuntu-latest" debian: "inecs/ansible-lab:debian-latest" + systemd_defaults: privileged: true command: "/sbin/init" diff --git a/molecule/presets/multi-os.yml b/molecule/presets/multi-os.yml index 0452552..d81e1e2 100644 --- a/molecule/presets/multi-os.yml +++ b/molecule/presets/multi-os.yml @@ -8,8 +8,6 @@ generated_inventory: "{{ molecule_ephemeral_directory }}/inventory/hosts.ini" # systemd-ready образы для разных ОС images: - debian: "ghcr.io/ansible-community/molecule-ubuntu-systemd:jammy" - # Собственные образы AnsibleTemplate alt: "inecs/ansible-lab:alt-linux-latest" astra: "inecs/ansible-lab:astra-linux-latest" rhel: "inecs/ansible-lab:rhel-latest" @@ -19,6 +17,7 @@ images: redos: "inecs/ansible-lab:redos-latest" ubuntu: "inecs/ansible-lab:ubuntu-latest" debian: "inecs/ansible-lab:debian-latest" + systemd_defaults: privileged: true command: "/sbin/init" diff --git a/molecule/presets/performance.yml b/molecule/presets/performance.yml index 51d14fb..4cee82c 100644 --- a/molecule/presets/performance.yml +++ b/molecule/presets/performance.yml @@ -8,8 +8,6 @@ generated_inventory: "{{ molecule_ephemeral_directory }}/inventory/hosts.ini" # systemd-ready образы images: - debian: "ghcr.io/ansible-community/molecule-ubuntu-systemd:jammy" - # Собственные образы AnsibleTemplate alt: "inecs/ansible-lab:alt-linux-latest" astra: "inecs/ansible-lab:astra-linux-latest" rhel: "inecs/ansible-lab:rhel-latest" @@ -19,6 +17,7 @@ images: redos: "inecs/ansible-lab:redos-latest" ubuntu: "inecs/ansible-lab:ubuntu-latest" debian: "inecs/ansible-lab:debian-latest" + systemd_defaults: privileged: true command: "/sbin/init" diff --git a/molecule/presets/security.yml b/molecule/presets/security.yml index ff67b53..01109f8 100644 --- a/molecule/presets/security.yml +++ b/molecule/presets/security.yml @@ -8,8 +8,6 @@ generated_inventory: "{{ molecule_ephemeral_directory }}/inventory/hosts.ini" # systemd-ready образы images: - debian: "ghcr.io/ansible-community/molecule-ubuntu-systemd:jammy" - # Собственные образы AnsibleTemplate alt: "inecs/ansible-lab:alt-linux-latest" astra: "inecs/ansible-lab:astra-linux-latest" rhel: "inecs/ansible-lab:rhel-latest" @@ -19,6 +17,7 @@ images: redos: "inecs/ansible-lab:redos-latest" ubuntu: "inecs/ansible-lab:ubuntu-latest" debian: "inecs/ansible-lab:debian-latest" + systemd_defaults: privileged: true command: "/sbin/init" diff --git a/molecule/presets/standart.yml b/molecule/presets/standart.yml index 6f4de34..1085786 100644 --- a/molecule/presets/standart.yml +++ b/molecule/presets/standart.yml @@ -8,8 +8,6 @@ generated_inventory: "{{ molecule_ephemeral_directory }}/inventory/hosts.ini" # systemd-ready образы images: - debian: "ghcr.io/ansible-community/molecule-ubuntu-systemd:jammy" - # Собственные образы AnsibleTemplate alt: "inecs/ansible-lab:alt-linux-latest" astra: "inecs/ansible-lab:astra-linux-latest" rhel: "inecs/ansible-lab:rhel-latest" @@ -19,6 +17,7 @@ images: redos: "inecs/ansible-lab:redos-latest" ubuntu: "inecs/ansible-lab:ubuntu-latest" debian: "inecs/ansible-lab:debian-latest" + systemd_defaults: privileged: true command: "/sbin/init" diff --git a/molecule/presets/test.yml b/molecule/presets/test.yml index db23d30..db39883 100644 --- a/molecule/presets/test.yml +++ b/molecule/presets/test.yml @@ -8,8 +8,6 @@ generated_inventory: "{{ molecule_ephemeral_directory }}/inventory/hosts.ini" # systemd-ready образы images: - debian: "ghcr.io/ansible-community/molecule-ubuntu-systemd:jammy" - # Собственные образы AnsibleTemplate alt: "inecs/ansible-lab:alt-linux-latest" astra: "inecs/ansible-lab:astra-linux-latest" rhel: "inecs/ansible-lab:rhel-latest" @@ -19,6 +17,7 @@ images: redos: "inecs/ansible-lab:redos-latest" ubuntu: "inecs/ansible-lab:ubuntu-latest" debian: "inecs/ansible-lab:debian-latest" + systemd_defaults: privileged: true command: "/sbin/init"