Break adding cloudinit drive and configuring cloudinit into two tasks

master
Ronald 1 year ago
parent f62a2a9d4a
commit 27d0920c18

@ -16,4 +16,6 @@ create_vm_proxmox_cloudinit_storage_pool: local-lvm
create_vm_proxmox_connect_to_vm: true
create_vm_proxmox_remove_ssh_host_key: true
create_vm_proxmox_add_cloudinit_drive: false
...

@ -68,7 +68,19 @@
- create_vm_proxmox_vm_disks is defined
delegate_to: localhost
- name: Add cloud-init drive to VM
- name: Add cloud-init drive
community.general.proxmox_kvm:
api_host: "{{ create_vm_proxmox_host }}"
api_user: "{{ create_vm_proxmox_user }}"
api_password: "{{ create_vm_proxmox_password }}"
node: "{{ create_vm_proxmox_host }}"
vmid: "{{ create_vm_proxmox_vmid }}"
name: "{{ create_vm_proxmox_name }}"
ide:
ide2: "{{ create_vm_proxmox_cloudinit_storage_pool }}:cloudinit,format=raw"
when: create_vm_proxmox_add_cloudinit_drive | bool
- name: Add cloud-init settings
community.general.proxmox_kvm:
api_host: "{{ create_vm_proxmox_host }}"
api_user: "{{ create_vm_proxmox_user }}"
@ -84,8 +96,6 @@
ipconfig: "{{ create_vm_proxmox_cloudinit_ipconfig }}"
nameservers: "{{ create_vm_proxmox_cloudinit_nameservers }}"
searchdomains: "{{ create_vm_proxmox_cloudinit_searchdomains }}"
ide:
ide2: "{{ create_vm_proxmox_cloudinit_storage_pool }}:cloudinit,format=raw"
when:
- create_vm_proxmox_check_if_vm_exists.proxmox_vms | length == 0
- create_vm_proxmox_configure_cloudinit | bool

Loading…
Cancel
Save