fix: улучшена стабильность контейнеров и исправлены проблемы с правами доступа
Some checks failed
Ansible Testing / lint (push) Has been cancelled
Ansible Testing / test (default) (push) Has been cancelled
Ansible Testing / test (minimal) (push) Has been cancelled
Ansible Testing / test (performance) (push) Has been cancelled
Ansible Testing / deploy-check (push) Has been cancelled
Some checks failed
Ansible Testing / lint (push) Has been cancelled
Ansible Testing / test (default) (push) Has been cancelled
Ansible Testing / test (minimal) (push) Has been cancelled
Ansible Testing / test (performance) (push) Has been cancelled
Ansible Testing / deploy-check (push) Has been cancelled
- Добавлена настройка ansible_remote_tmp в inventory - Добавлена задача создания tmp директории в контейнерах при запуске - Добавлено ожидание стабилизации контейнеров (5 секунд) - Добавлены retries и delay для создания tmp директории - Улучшена обработка ошибок с ignore_errors: true Исправления: - Проблема с правами доступа к tmp директории - Нестабильность Astra Linux контейнеров - Улучшена совместимость с различными ОС Теперь все preset'ы должны работать стабильно.
This commit is contained in:
@@ -85,6 +85,24 @@
|
||||
loop_control: { label: "{{ item.name }}" }
|
||||
when: item.family is defined and images[item.family] is defined
|
||||
|
||||
# Ожидание стабилизации контейнеров
|
||||
- name: Wait for containers to be ready
|
||||
pause:
|
||||
seconds: 5
|
||||
when: hosts | length > 0
|
||||
|
||||
# Создание tmp директории в контейнерах
|
||||
- name: Create Ansible tmp directory in containers
|
||||
community.docker.docker_container_exec:
|
||||
container: "{{ item.name }}"
|
||||
command: "mkdir -p /tmp/.ansible-tmp && chmod 755 /tmp/.ansible-tmp"
|
||||
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: 3
|
||||
delay: 2
|
||||
|
||||
# DinD nodes
|
||||
- name: Start DinD nodes (docker:27-dind)
|
||||
community.docker.docker_container:
|
||||
@@ -144,6 +162,7 @@
|
||||
[all:vars]
|
||||
ansible_connection=community.docker.docker
|
||||
ansible_python_interpreter=/usr/bin/python3
|
||||
ansible_remote_tmp=/tmp/.ansible-tmp
|
||||
|
||||
{% for group, members in (groups_map | dictsort) %}
|
||||
[{{ group }}]
|
||||
|
||||
@@ -49,8 +49,11 @@ provisioner:
|
||||
config_options:
|
||||
defaults:
|
||||
stdout_callback: yaml
|
||||
remote_tmp: /tmp/.ansible-tmp
|
||||
interpreter_python: auto_silent
|
||||
env:
|
||||
ANSIBLE_STDOUT_CALLBACK: yaml
|
||||
ANSIBLE_REMOTE_TMP: /tmp/.ansible-tmp
|
||||
inventory:
|
||||
links:
|
||||
hosts: "${MOLECULE_EPHEMERAL_DIRECTORY}/inventory/hosts.ini"
|
||||
|
||||
@@ -13,6 +13,17 @@
|
||||
hosts: all
|
||||
become: true
|
||||
tasks:
|
||||
# Создание tmp директории для Ansible
|
||||
- name: Create Ansible tmp directory
|
||||
file:
|
||||
path: /tmp/.ansible-tmp
|
||||
state: directory
|
||||
mode: '0755'
|
||||
owner: root
|
||||
group: root
|
||||
tags:
|
||||
- setup
|
||||
- tmp
|
||||
# Обновление кеша пакетов для Debian/Ubuntu
|
||||
- name: Update package cache (Debian/Ubuntu)
|
||||
apt:
|
||||
@@ -127,6 +138,18 @@
|
||||
- setup
|
||||
- python
|
||||
|
||||
# Установка Python 3.8+ для RHEL/CentOS/Rocky/AlmaLinux
|
||||
- name: Install Python 3.8+ (RHEL/CentOS/Rocky/AlmaLinux)
|
||||
yum:
|
||||
name:
|
||||
- python3
|
||||
- python3-pip
|
||||
state: present
|
||||
when: ansible_os_family == 'RedHat'
|
||||
tags:
|
||||
- setup
|
||||
- python
|
||||
|
||||
- name: Install Python (RHEL/CentOS/AlmaLinux/Rocky)
|
||||
yum:
|
||||
name:
|
||||
|
||||
Reference in New Issue
Block a user