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

This commit is contained in:
2025-12-28 08:15:41 +00:00
parent f787f05965
commit 1dec603074

View File

@@ -4,15 +4,28 @@
connection: local connection: local
gather_facts: false gather_facts: false
tasks: tasks:
- name: Create terraform mirror config locally
copy:
dest: "{{ playbook_dir }}/../terraform/.terraformrc" # Кладем прямо в папку с кодом
content: |
provider_installation {
network_mirror {
url = "https://terraform-mirror.yandexcloud.net/"
}
direct {
exclude = ["registry.terraform.io/*/*"]
}
}
- name: Run Terraform Apply - name: Run Terraform Apply
community.general.terraform: community.general.terraform:
project_path: "{{ playbook_dir }}/../terraform" # путь к папке с .tf файлами в вашем репозитории project_path: "{{ playbook_dir }}/../terraform"
state: present state: present
force_init: true force_init: true
init_reconfigure: true init_reconfigure: true
environment: environment:
TF_CLI_CONFIG_FILE: "/tmp/.terraformrc" # Указываем Terraform искать конфиг именно здесь
register: tf_result TF_CLI_CONFIG_FILE: "{{ playbook_dir }}/../terraform/.terraformrc"
- name: Wait for SSH to be ready - name: Wait for SSH to be ready
wait_for: wait_for: