Обновление проекта
This commit is contained in:
		| @@ -3,6 +3,12 @@ | ||||
| # Автор: Сергей Антропов | ||||
| # Сайт: https://devops.org.ru | ||||
|  | ||||
| - name: "Reset ANSI color codes" | ||||
|   debug: | ||||
|     msg: "\033[0m" | ||||
|   changed_when: false | ||||
|   tags: [python, color-reset] | ||||
|  | ||||
| - name: "Отладочная информация о системе" | ||||
|   debug: | ||||
|     msg: | ||||
| @@ -85,6 +91,14 @@ | ||||
|     - python_current_package_manager in ['apt', 'dnf', 'zypper'] | ||||
|     - python_current_package_manager != 'unknown' | ||||
|  | ||||
| - name: "Обновление списка пакетов (ClearLinux)" | ||||
|   command: "swupd update" | ||||
|   changed_when: false | ||||
|   when: | ||||
|     - python_current_package_manager == 'swupd' | ||||
|     - python_current_package_manager != 'unknown' | ||||
|   ignore_errors: true | ||||
|  | ||||
| - name: "Обновление списка пакетов после добавления репозиториев" | ||||
|   package: | ||||
|     name: "*" | ||||
| @@ -104,6 +118,14 @@ | ||||
|   when: | ||||
|     - python_current_build_deps | length > 0 | ||||
|     - python_current_package_manager != 'unknown' | ||||
|     - python_current_package_manager != 'swupd' | ||||
|   ignore_errors: true | ||||
|  | ||||
| - name: "Установка системных зависимостей для компиляции (ClearLinux)" | ||||
|   command: "swupd bundle-add {{ python_current_build_deps | join(' ') }}" | ||||
|   when: | ||||
|     - python_current_build_deps | length > 0 | ||||
|     - python_current_package_manager == 'swupd' | ||||
|   ignore_errors: true | ||||
|  | ||||
| # ============================================================================= | ||||
| @@ -124,6 +146,16 @@ | ||||
|   when: | ||||
|     - python_current_packages | length > 0 | ||||
|     - python_current_package_manager != 'unknown' | ||||
|     - python_current_package_manager != 'swupd' | ||||
|     - python_version_check.rc != 0 | ||||
|   register: python_package_install | ||||
|   ignore_errors: true | ||||
|  | ||||
| - name: "Установка Python из пакетов (ClearLinux)" | ||||
|   command: "swupd bundle-add {{ python_current_packages | join(' ') }}" | ||||
|   when: | ||||
|     - python_current_packages | length > 0 | ||||
|     - python_current_package_manager == 'swupd' | ||||
|     - python_version_check.rc != 0 | ||||
|   register: python_package_install | ||||
|   ignore_errors: true | ||||
| @@ -187,7 +219,7 @@ | ||||
|     - python_current_packages | length == 0 | ||||
|     - python_version_check.rc != 0 | ||||
|     - download_result is defined | ||||
|     - download_result.status_code == 200 | ||||
|     - download_result.rc is defined and download_result.rc == 0 | ||||
|  | ||||
| - name: "Конфигурация Python для компиляции" | ||||
|   command: > | ||||
| @@ -207,7 +239,7 @@ | ||||
|     - python_current_packages | length == 0 | ||||
|     - python_version_check.rc != 0 | ||||
|     - download_result is defined | ||||
|     - download_result.status_code == 200 | ||||
|     - download_result.rc is defined and download_result.rc == 0 | ||||
|  | ||||
| - name: "Компиляция Python" | ||||
|   make: | ||||
| @@ -217,7 +249,7 @@ | ||||
|     - python_current_packages | length == 0 | ||||
|     - python_version_check.rc != 0 | ||||
|     - download_result is defined | ||||
|     - download_result.status_code == 200 | ||||
|     - download_result.rc is defined and download_result.rc == 0 | ||||
|  | ||||
| - name: "Установка скомпилированного Python" | ||||
|   make: | ||||
| @@ -228,7 +260,7 @@ | ||||
|     - python_current_packages | length == 0 | ||||
|     - python_version_check.rc != 0 | ||||
|     - download_result is defined | ||||
|     - download_result.status_code == 200 | ||||
|     - download_result.rc is defined and download_result.rc == 0 | ||||
|  | ||||
| - name: "Обновление библиотек для скомпилированного Python" | ||||
|   command: "ldconfig" | ||||
| @@ -238,7 +270,7 @@ | ||||
|     - python_current_packages | length == 0 | ||||
|     - python_version_check.rc != 0 | ||||
|     - download_result is defined | ||||
|     - download_result.status_code == 200 | ||||
|     - download_result.rc is defined and download_result.rc == 0 | ||||
|  | ||||
| # ============================================================================= | ||||
| # ЭТАП 7: СОЗДАНИЕ СИМВОЛИЧЕСКИХ ССЫЛОК | ||||
| @@ -407,6 +439,19 @@ | ||||
|     - pip_latest_version is defined | ||||
|     - pip_current_version.stdout is defined | ||||
|     - pip_latest_version not in pip_current_version.stdout | ||||
|     - python_current_package_manager != 'swupd' | ||||
|   ignore_errors: true | ||||
|  | ||||
| - name: "Обновление pip до последней версии (ClearLinux)" | ||||
|   command: "{{ python_current_pip }} install --upgrade pip --break-system-packages" | ||||
|   changed_when: false | ||||
|   when: | ||||
|     - python_version_check.rc == 0 | ||||
|     - pip_current_version.rc == 0 | ||||
|     - pip_latest_version is defined | ||||
|     - pip_current_version.stdout is defined | ||||
|     - pip_latest_version not in pip_current_version.stdout | ||||
|     - python_current_package_manager == 'swupd' | ||||
|   ignore_errors: true | ||||
|  | ||||
| # ============================================================================= | ||||
| @@ -473,6 +518,7 @@ | ||||
|   package_facts: | ||||
|     manager: "{{ python_current_package_manager }}" | ||||
|   when: python_current_package_manager != 'unknown' | ||||
|   ignore_errors: true | ||||
|  | ||||
| - name: "Финальный отчет об установке" | ||||
|   debug: | ||||
| @@ -483,10 +529,10 @@ | ||||
|       ================================================================================ | ||||
|  | ||||
|       📊 ИНФОРМАЦИЯ О СИСТЕМЕ: | ||||
|       • Дистрибутив: {{ system_facts.ansible_facts.distribution }} {{ system_facts.ansible_facts.distribution_version }} | ||||
|       • Семейство ОС: {{ system_facts.ansible_facts.os_family }} | ||||
|       • Архитектура: {{ system_facts.ansible_facts.architecture }} | ||||
|       • Ядро: {{ system_facts.ansible_facts.kernel }} | ||||
|       • Дистрибутив: {{ ansible_distribution }} {{ ansible_distribution_version }} | ||||
|       • Семейство ОС: {{ ansible_os_family }} | ||||
|       • Архитектура: {{ ansible_architecture }} | ||||
|       • Ядро: {{ ansible_kernel }} | ||||
|  | ||||
|       🐍 PYTHON: | ||||
|       • Версия: {{ final_python_version.stdout | default('НЕ УСТАНОВЛЕН') }} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user