From 224695eb860e6e31a1fa22e2afbca6ca5ca06f29 Mon Sep 17 00:00:00 2001 From: ogrechko Date: Sun, 28 Dec 2025 09:39:51 +0000 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20ansible/deploy=5Fall.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ansible/deploy_all.yml | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/ansible/deploy_all.yml b/ansible/deploy_all.yml index b489122..5c32161 100644 --- a/ansible/deploy_all.yml +++ b/ansible/deploy_all.yml @@ -12,7 +12,7 @@ content: | provider_installation { network_mirror { - url = "https://terraform-mirror.yandexcloud.net/" + url = "https://registry.tf-mirror.ru/" } direct { exclude = ["registry.terraform.io/*/*"] @@ -24,31 +24,26 @@ path: "{{ playbook_dir }}/../terraform/.terraform" state: absent - - name: Terraform Init - shell: terraform init -reconfigure -no-color + - name: Terraform Init and Apply + shell: | + terraform init -reconfigure -upgrade -no-color && \ + terraform apply -auto-approve -no-color -lock=false args: chdir: "{{ playbook_dir }}/../terraform" + register: tf_output environment: TF_CLI_CONFIG_FILE: "/tmp/.terraformrc" TF_HTTP_ADDRESS: "{{ lookup('env', 'TF_HTTP_ADDRESS') }}" TF_HTTP_USERNAME: "{{ lookup('env', 'TF_HTTP_USERNAME') }}" TF_HTTP_PASSWORD: "{{ lookup('env', 'TF_HTTP_PASSWORD') }}" - - - name: Terraform Apply - # МЫ ДОБАВИЛИ -lock=false, чтобы Gitea не ругалась на 405 ошибку - shell: terraform apply -auto-approve -no-color -lock=false - args: - chdir: "{{ playbook_dir }}/../terraform" - environment: - TF_CLI_CONFIG_FILE: "/tmp/.terraformrc" - TF_HTTP_ADDRESS: "{{ lookup('env', 'TF_HTTP_ADDRESS') }}" - TF_HTTP_USERNAME: "{{ lookup('env', 'TF_HTTP_USERNAME') }}" - TF_HTTP_PASSWORD: "{{ lookup('env', 'TF_HTTP_PASSWORD') }}" - # Прокидываем переменные для Proxmox TF_VAR_proxmox_api_token_id: "{{ lookup('env', 'TF_VAR_proxmox_api_token_id') }}" TF_VAR_proxmox_api_token_secret: "{{ lookup('env', 'TF_VAR_proxmox_api_token_secret') }}" TF_VAR_proxmox_api_url: "{{ lookup('env', 'TF_VAR_proxmox_api_url') }}" + - name: Show Terraform Output + debug: + var: tf_output.stdout_lines + - name: Dynamically add hosts add_host: name: "{{ item }}"