Обновить test-playbooks/deploy.yml

This commit is contained in:
2025-12-03 12:48:06 +00:00
parent b006ca5ae8
commit 889642bc7e

View File

@@ -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 - name: Configure Windows PC
hosts: windows hosts: windows
gather_facts: yes gather_facts: yes
tasks: tasks:
- name: Ping Windows - name: Проверка связи (Ping)
ansible.windows.win_ping: ansible.windows.win_ping:
- name: Install Chocolatey (Package Manager) - name: Узнать имя компьютера
ansible.windows.win_shell: | ansible.windows.win_shell: hostname
Set-ExecutionPolicy Bypass -Scope Process -Force; register: host_out
[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: Install Git on Windows - name: Показать имя
win_chocolatey: debug:
name: git var: host_out.stdout_lines
state: present
# Пример: Создать папку на диске C
- name: Create directory
ansible.windows.win_file:
path: C:\Temp\FromSemaphore
state: directory