Обновить ansible/deploy_all.yml
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user