Обновить ansible/deploy_all.yml

This commit is contained in:
2025-12-28 08:20:46 +00:00
parent d6ffaaf4cc
commit 120ace41f2

View File

@@ -2,11 +2,12 @@
- name: Step 1 - Terraform Provisioning - name: Step 1 - Terraform Provisioning
hosts: localhost hosts: localhost
connection: local connection: local
gather_facts: true # Включаем сбор фактов, чтобы знать домашнюю директорию gather_facts: true # Это важно, чтобы получить путь к HOME
tasks: tasks:
- name: Create terraform mirror config in /tmp - name: Create terraform mirror config in HOME
copy: copy:
dest: "/tmp/.terraformrc" dest: "{{ ansible_user_dir }}/.terraformrc"
mode: '0644'
content: | content: |
provider_installation { provider_installation {
network_mirror { network_mirror {
@@ -22,10 +23,8 @@
project_path: "{{ playbook_dir }}/../terraform" project_path: "{{ playbook_dir }}/../terraform"
state: present state: present
force_init: true force_init: true
init_reconfigure: true init_reconfigure: true # Это уберет ошибку "Backend initialization required"
environment: # Environment больше не нужен, Terraform сам найдет ~/.terraformrc
# Используем жесткий абсолютный путь
TF_CLI_CONFIG_FILE: "/tmp/.terraformrc"
- name: Wait for SSH to be ready - name: Wait for SSH to be ready
wait_for: wait_for: