From 594b9d16a7fca66731df061951e5e818db8f3858 Mon Sep 17 00:00:00 2001 From: ogrechko Date: Wed, 6 May 2026 20:29:55 +0300 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/expand=5Fubuntu=5Fdisk=5Fworkflow.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ansible/expand_ubuntu_disk_workflow.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/ansible/expand_ubuntu_disk_workflow.yml b/ansible/expand_ubuntu_disk_workflow.yml index a25cdec..50eef39 100644 --- a/ansible/expand_ubuntu_disk_workflow.yml +++ b/ansible/expand_ubuntu_disk_workflow.yml @@ -1,4 +1,3 @@ ---- - name: Stage 1 - Resize disk in vCenter with Terraform hosts: localhost connection: local @@ -9,11 +8,25 @@ tf_dir: "{{ playbook_dir }}/../terraform/resize-vm-disk" tasks: + - name: Create terraform CLI config + ansible.builtin.copy: + dest: "/tmp/.terraformrc" + content: | + provider_installation { + direct {} + } + + - name: Cleanup old terraform files + ansible.builtin.shell: rm -rf .terraform .terraform.lock.hcl + args: + chdir: "{{ tf_dir }}" + - name: Terraform init ansible.builtin.shell: terraform init -reconfigure -no-color args: chdir: "{{ tf_dir }}" environment: + TF_CLI_CONFIG_FILE: "/tmp/.terraformrc" TF_VAR_vsphere_server: "{{ vsphere_server }}" TF_VAR_vsphere_datacenter: "{{ vsphere_datacenter }}" TF_VAR_vsphere_user: "{{ vsphere_user }}" @@ -26,6 +39,7 @@ args: chdir: "{{ tf_dir }}" environment: + TF_CLI_CONFIG_FILE: "/tmp/.terraformrc" TF_VAR_vsphere_server: "{{ vsphere_server }}" TF_VAR_vsphere_datacenter: "{{ vsphere_datacenter }}" TF_VAR_vsphere_user: "{{ vsphere_user }}" @@ -44,6 +58,7 @@ ansible_become_password: "{{ ansible_become_password }}" ansible_ssh_extra_args: "-o StrictHostKeyChecking=no" + - name: Stage 2 - Wait for SSH hosts: ubuntu_resize_group gather_facts: false