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