From 889642bc7ecedad6ea649090bc2e30a5b701e389 Mon Sep 17 00:00:00 2001 From: ogrechko Date: Wed, 3 Dec 2025 12:48:06 +0000 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20test-playbooks/deploy.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test-playbooks/deploy.yml | 43 ++++++++++++--------------------------- 1 file changed, 13 insertions(+), 30 deletions(-) diff --git a/test-playbooks/deploy.yml b/test-playbooks/deploy.yml index 014de40..fb18a88 100644 --- a/test-playbooks/deploy.yml +++ b/test-playbooks/deploy.yml @@ -1,38 +1,21 @@ --- -- name: Infrastructure and Configuration - hosts: localhost - connection: local - gather_facts: no - tasks: - # БЛОК 1: Запуск Terraform (создание инфраструктуры, если нужно) - - name: Apply Terraform - community.general.terraform: - project_path: '{{ playbook_dir }}/terraform/' # Путь к файлам .tf в репозитории - state: present - force_init: true - register: tf_result - - - name: Show Terraform Output - debug: - var: tf_result.stdout - -# БЛОК 2: Настройка Windows (после того, как она поднята или если она уже есть) - name: Configure Windows PC hosts: windows gather_facts: yes tasks: - - name: Ping Windows + - name: Проверка связи (Ping) ansible.windows.win_ping: - - name: Install Chocolatey (Package Manager) - ansible.windows.win_shell: | - Set-ExecutionPolicy Bypass -Scope Process -Force; - [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; - iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) - args: - creates: C:\ProgramData\chocolatey\bin\choco.exe + - name: Узнать имя компьютера + ansible.windows.win_shell: hostname + register: host_out - - name: Install Git on Windows - win_chocolatey: - name: git - state: present \ No newline at end of file + - name: Показать имя + debug: + var: host_out.stdout_lines + + # Пример: Создать папку на диске C + - name: Create directory + ansible.windows.win_file: + path: C:\Temp\FromSemaphore + state: directory \ No newline at end of file