Обновить ansible/expand_ubuntu_disk_workflow.yml
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
---
|
|
||||||
- name: Stage 1 - Resize disk in vCenter with Terraform
|
- name: Stage 1 - Resize disk in vCenter with Terraform
|
||||||
hosts: localhost
|
hosts: localhost
|
||||||
connection: local
|
connection: local
|
||||||
@@ -9,11 +8,25 @@
|
|||||||
tf_dir: "{{ playbook_dir }}/../terraform/resize-vm-disk"
|
tf_dir: "{{ playbook_dir }}/../terraform/resize-vm-disk"
|
||||||
|
|
||||||
tasks:
|
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
|
- name: Terraform init
|
||||||
ansible.builtin.shell: terraform init -reconfigure -no-color
|
ansible.builtin.shell: terraform init -reconfigure -no-color
|
||||||
args:
|
args:
|
||||||
chdir: "{{ tf_dir }}"
|
chdir: "{{ tf_dir }}"
|
||||||
environment:
|
environment:
|
||||||
|
TF_CLI_CONFIG_FILE: "/tmp/.terraformrc"
|
||||||
TF_VAR_vsphere_server: "{{ vsphere_server }}"
|
TF_VAR_vsphere_server: "{{ vsphere_server }}"
|
||||||
TF_VAR_vsphere_datacenter: "{{ vsphere_datacenter }}"
|
TF_VAR_vsphere_datacenter: "{{ vsphere_datacenter }}"
|
||||||
TF_VAR_vsphere_user: "{{ vsphere_user }}"
|
TF_VAR_vsphere_user: "{{ vsphere_user }}"
|
||||||
@@ -26,6 +39,7 @@
|
|||||||
args:
|
args:
|
||||||
chdir: "{{ tf_dir }}"
|
chdir: "{{ tf_dir }}"
|
||||||
environment:
|
environment:
|
||||||
|
TF_CLI_CONFIG_FILE: "/tmp/.terraformrc"
|
||||||
TF_VAR_vsphere_server: "{{ vsphere_server }}"
|
TF_VAR_vsphere_server: "{{ vsphere_server }}"
|
||||||
TF_VAR_vsphere_datacenter: "{{ vsphere_datacenter }}"
|
TF_VAR_vsphere_datacenter: "{{ vsphere_datacenter }}"
|
||||||
TF_VAR_vsphere_user: "{{ vsphere_user }}"
|
TF_VAR_vsphere_user: "{{ vsphere_user }}"
|
||||||
@@ -44,6 +58,7 @@
|
|||||||
ansible_become_password: "{{ ansible_become_password }}"
|
ansible_become_password: "{{ ansible_become_password }}"
|
||||||
ansible_ssh_extra_args: "-o StrictHostKeyChecking=no"
|
ansible_ssh_extra_args: "-o StrictHostKeyChecking=no"
|
||||||
|
|
||||||
|
|
||||||
- name: Stage 2 - Wait for SSH
|
- name: Stage 2 - Wait for SSH
|
||||||
hosts: ubuntu_resize_group
|
hosts: ubuntu_resize_group
|
||||||
gather_facts: false
|
gather_facts: false
|
||||||
|
|||||||
Reference in New Issue
Block a user