feat: Переименование geop в cod и добавление ARM64 поддержки

- Переименован пресет geop.yml в cod.yml
- Обновлены все группы с geop на cod
- Добавлена поддержка ARM64 для Astra Linux и RedOS
- Создан Dockerfile.arm64 для RedOS с исправлением конфликтов пакетов
- Улучшены разделители в логах Molecule
- Зашифрован файл vault/secrets.yml
- Обновлена роль devops с поддержкой vault
- Добавлены шаблоны для SSH и sudoers конфигураций
This commit is contained in:
Сергей Антропов
2025-10-27 19:43:26 +03:00
parent c66bb35f97
commit 5543ae4d27
25 changed files with 1531 additions and 931 deletions

View File

@@ -1,4 +1,7 @@
---
# =============================================================================
# CREATE - Создание тестовых инстансов
# =============================================================================
- hosts: localhost
gather_facts: false
vars:
@@ -14,13 +17,21 @@
alt9: "inecs/ansible-lab:alt9-latest"
alt10: "inecs/ansible-lab:alt10-latest"
astra: "inecs/ansible-lab:astra-linux-latest"
astra-arm64: "inecs/ansible-lab:astra-linux-arm64-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
command: "/sbin/init"
@@ -85,14 +96,43 @@
- name: Display filtered hosts
debug:
msg: "Platform {{ ansible_architecture }}: {{ hosts | length }} hosts will be deployed"
msg: |
================================================================================
СОЗДАНИЕ ТЕСТОВЫХ ИНСТАНСОВ
================================================================================
Platform: {{ ansible_architecture }}
Hosts: {{ hosts | length }}
================================================================================
# =============================================================================
# СЕТЕВОЕ ПОДКЛЮЧЕНИЕ
# =============================================================================
- name: Network setup
debug:
msg: |
================================================================================
НАСТРОЙКА СЕТИ
================================================================================
Network: {{ docker_network }}
================================================================================
- name: Ensure network exists
community.docker.docker_network:
name: "{{ docker_network }}"
state: present
# SYSTEMD nodes
# =============================================================================
# SYSTEMD NODES - Создание контейнеров с systemd
# =============================================================================
- name: Systemd nodes setup
debug:
msg: |
================================================================================
SYSTEMD NODES - Создание контейнеров с systemd
================================================================================
Count: {{ hosts | selectattr('type','undefined') | list | length }}
================================================================================
- name: Pull systemd images with correct platform
command: "docker pull --platform {{ ansible_architecture }} {{ images[item.family] }}"
loop: "{{ hosts | selectattr('type','undefined') | list }}"
@@ -208,7 +248,30 @@
retries: 5
delay: 3
# DinD nodes
# Создание vault директории в контейнерах
- name: Create vault directory in containers
community.docker.docker_container_exec:
container: "{{ item.name }}"
command: "mkdir -p /workspace/vault && chmod 755 /workspace/vault"
loop: "{{ hosts | selectattr('type','undefined') | list }}"
loop_control: { label: "{{ item.name }}" }
when: item.family is defined and images[item.family] is defined
ignore_errors: true
retries: 5
delay: 3
# =============================================================================
# DIND NODES - Создание контейнеров Docker-in-Docker
# =============================================================================
- name: DinD nodes setup
debug:
msg: |
================================================================================
DIND NODES - Создание контейнеров Docker-in-Docker
================================================================================
Count: {{ hosts | selectattr('type','defined') | selectattr('type','equalto','dind') | list | length }}
================================================================================
- name: Start DinD nodes (docker:27-dind)
community.docker.docker_container:
name: "{{ item.name }}"
@@ -225,7 +288,18 @@
loop: "{{ hosts | selectattr('type','defined') | selectattr('type','equalto','dind') | list }}"
loop_control: { label: "{{ item.name }}" }
# DOoD nodes (mount docker.sock)
# =============================================================================
# DOOD NODES - Создание контейнеров Docker-out-of-Docker
# =============================================================================
- name: DOoD nodes setup
debug:
msg: |
================================================================================
DOOD NODES - Создание контейнеров Docker-out-of-Docker
================================================================================
Count: {{ hosts | selectattr('type','defined') | selectattr('type','equalto','dood') | list | length }}
================================================================================
- name: Start DOoD nodes (systemd + docker.sock mount)
community.docker.docker_container:
name: "{{ item.name }}"
@@ -260,7 +334,18 @@
item_name: "{{ item.0.name }}"
item_group: "{{ item.1 }}"
# Render inventory
# =============================================================================
# ИНВЕНТАРЬ - Генерация inventory файла
# =============================================================================
- name: Inventory generation
debug:
msg: |
================================================================================
ИНВЕНТАРЬ - Генерация inventory файла
================================================================================
File: {{ generated_inventory }}
================================================================================
- name: Render inventory ini
set_fact:
inv_content: |
@@ -327,7 +412,7 @@
{% endif %}
{# Глобальный fallback для остальных хостов #}
[unmatched_hosts:vars]
[all:vars]
ansible_python_interpreter=auto_silent
- name: Write inventory file