-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathawx-proxmox-resize-vm-disk.yml
36 lines (31 loc) · 1.07 KB
/
awx-proxmox-resize-vm-disk.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
- name: "Proxmox: resize scsi0"
connection: local
hosts: all
gather_facts: False
vars:
collected_proxmox_vms: {}
tasks:
- name: Include Proxmox common discovery
include_tasks: "ansible-tasks/collect-proxmox-vms.yml"
- name: Grow VM disk
community.general.proxmox_disk:
api_user: "{{ proxmox_env_info.api_user }}"
api_token_id: "{{ proxmox_env_info.api_token_id }}"
api_token_secret: "{{ proxmox_env_info.api_token_secret }}"
api_host: "{{ proxmox_env_info.api_host }}"
name: "{{ vm_config['name'] }}"
disk: "{{ vm_config['resize_disk'] }}"
size: "{{ (vm_config['resize_disk_size']|int / 1024) | round | int }}G"
state: resized
when: vm_config['name'] in collected_proxmox_vms
register: vm_update_disk_size
async: 180
poll: 0
- name: Wait for VM disk updates processes to finish
async_status:
jid: "{{ vm_update_disk_size.ansible_job_id }}"
when: vm_config['name'] in collected_proxmox_vms
register: _ujobs_alias_vc_0
until: _ujobs_alias_vc_0.finished
retries: 60
delay: 10