diff --git a/ansible/deploy_all.yml b/ansible/deploy_all.yml index 4a51844..7c71853 100644 --- a/ansible/deploy_all.yml +++ b/ansible/deploy_all.yml @@ -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 + 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: