|
|
|
|
@ -7,8 +7,7 @@
|
|
|
|
|
api_password: "{{ create_vm_proxmox_password }}"
|
|
|
|
|
vmid: "{{ create_vm_proxmox_vmid }}"
|
|
|
|
|
register: create_vm_proxmox_check_if_vm_exists
|
|
|
|
|
when:
|
|
|
|
|
- create_vm_proxmox_recreate_vm | bool
|
|
|
|
|
when: create_vm_proxmox_recreate_vm | bool
|
|
|
|
|
delegate_to: localhost
|
|
|
|
|
|
|
|
|
|
- name: Proxmox - Delete VM if it already exists
|
|
|
|
|
@ -48,8 +47,7 @@
|
|
|
|
|
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
|
|
|
|
|
when: create_vm_proxmox_check_if_vm_exists.proxmox_vms | length == 0
|
|
|
|
|
delegate_to: localhost
|
|
|
|
|
|
|
|
|
|
- name: Proxmox - Manage virtual disks for virtual machine
|
|
|
|
|
@ -64,8 +62,7 @@
|
|
|
|
|
size: "{{ item.value.size | default(omit) }}"
|
|
|
|
|
state: "{{ item.value.state | default(omit) }}"
|
|
|
|
|
loop: "{{ create_vm_proxmox_vm_disks | dict2items }}"
|
|
|
|
|
when:
|
|
|
|
|
- create_vm_proxmox_vm_disks is defined
|
|
|
|
|
when: create_vm_proxmox_vm_disks is defined
|
|
|
|
|
delegate_to: localhost
|
|
|
|
|
|
|
|
|
|
- name: Proxmox - Add cloud-init drive
|
|
|
|
|
@ -111,8 +108,7 @@
|
|
|
|
|
name: "{{ create_vm_proxmox_name }}"
|
|
|
|
|
agent: true
|
|
|
|
|
update: true
|
|
|
|
|
when:
|
|
|
|
|
- create_vm_proxmox_enable_guest_agent | bool
|
|
|
|
|
when: create_vm_proxmox_enable_guest_agent | bool
|
|
|
|
|
delegate_to: localhost
|
|
|
|
|
|
|
|
|
|
- name: Proxmox - Set VM to autostart
|
|
|
|
|
@ -125,8 +121,7 @@
|
|
|
|
|
name: "{{ create_vm_proxmox_name }}"
|
|
|
|
|
onboot: true
|
|
|
|
|
update: true
|
|
|
|
|
when:
|
|
|
|
|
- create_vm_proxmox_start_vm_onboot | bool
|
|
|
|
|
when: create_vm_proxmox_start_vm_onboot | bool
|
|
|
|
|
delegate_to: localhost
|
|
|
|
|
|
|
|
|
|
- name: Proxmox - Start VM
|
|
|
|
|
@ -138,8 +133,7 @@
|
|
|
|
|
vmid: "{{ create_vm_proxmox_vmid }}"
|
|
|
|
|
name: "{{ create_vm_proxmox_name }}"
|
|
|
|
|
state: started
|
|
|
|
|
when:
|
|
|
|
|
- create_vm_proxmox_start_vm
|
|
|
|
|
when: create_vm_proxmox_start_vm
|
|
|
|
|
delegate_to: localhost
|
|
|
|
|
|
|
|
|
|
...
|
|
|
|
|
|