Обновить 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
gather_facts: false
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
community.general.terraform:
project_path: "{{ playbook_dir }}/../terraform" # путь к папке с .tf файлами в вашем репозитории
project_path: "{{ playbook_dir }}/../terraform"
state: present
force_init: true
init_reconfigure: true
environment:
TF_CLI_CONFIG_FILE: "/tmp/.terraformrc"
register: tf_result
# Указываем Terraform искать конфиг именно здесь
TF_CLI_CONFIG_FILE: "{{ playbook_dir }}/../terraform/.terraformrc"
- name: Wait for SSH to be ready
wait_for: