Add task to update VM hardware

master
Ronald 8 months ago
parent 13b586d688
commit e1e6f1978f

@ -19,6 +19,7 @@
name: "{{ create_vm_proxmox_name }}"
state: absent
force: true
timeout: 30
when:
- create_vm_proxmox_check_if_vm_exists.proxmox_vms is defined
- create_vm_proxmox_check_if_vm_exists.proxmox_vms | length > 0
@ -34,6 +35,10 @@
register: create_vm_proxmox_check_if_vm_exists
delegate_to: localhost
- name: Debug
ansible.builtin.debug:
msg: "{{ create_vm_proxmox_numb_cores }} - {{ create_vm_proxmox_memory_mb }}"
- name: Proxmox - Clone VM in Proxmox
community.general.proxmox_kvm:
api_host: "{{ create_vm_proxmox_host }}"
@ -43,14 +48,24 @@
newid: "{{ create_vm_proxmox_vmid }}"
name: "{{ create_vm_proxmox_name }}"
clone: "{{ create_vm_proxmox_source_vm }}"
vcpus: "{{ create_vm_proxmox_numb_cpus | default(omit) }}"
cores: "{{ create_vm_proxmox_numb_cores | default(omit) }}"
memory: "{{ create_vm_proxmox_memory_mb | default(omit) }}"
net: "{{ create_vm_proxmox_net | default(omit) }}"
when: create_vm_proxmox_check_if_vm_exists.proxmox_vms | length == 0
register: create_vm_proxmox_clone_vm
delegate_to: localhost
- name: Proxmox - Update VM hardware
community.general.proxmox_kvm:
api_host: "{{ create_vm_proxmox_host }}"
api_user: "{{ create_vm_proxmox_user }}"
api_password: "{{ create_vm_proxmox_password }}"
vmid: "{{ create_vm_proxmox_vmid }}"
node: "{{ create_vm_proxmox_host }}"
vcpus: "{{ create_vm_proxmox_numb_cpus | default(omit) }}"
cores: "{{ create_vm_proxmox_numb_cores | default(omit) }}"
memory: "{{ create_vm_proxmox_memory_mb | default(omit) }}"
update: true
delegate_to: localhost
- name: Proxmox - Manage virtual disks for virtual machine
community.general.proxmox_disk:
api_host: "{{ create_vm_proxmox_host }}"
@ -74,9 +89,12 @@
node: "{{ create_vm_proxmox_host }}"
vmid: "{{ create_vm_proxmox_vmid }}"
name: "{{ create_vm_proxmox_name }}"
update: true
update_unsafe: true
ide:
ide2: "{{ create_vm_proxmox_cloudinit_storage_pool }}:cloudinit,format=raw"
when: create_vm_proxmox_add_cloudinit_drive | bool
delegate_to: localhost
- name: Proxmox - Add cloud-init settings
community.general.proxmox_kvm:

Loading…
Cancel
Save