--- - name: Create VM ID from IP address for Proxmox hosts hosts: all gather_facts: false tasks: - name: Modify Proxmox Ubuntu VM delegate_to: "localhost" when: platform is defined and platform == "proxmox" block: - name: Update cloud-init file community.proxmox.proxmox_kvm: api_user: "{{ proxmox_user }}" api_password: "{{ proxmox_password }}" api_host: "{{ proxmox_host }}" node: "{{ proxmox_clone_node }}" vmid: "{{ vm_id }}" ipconfig: ipconfig0: "ip=dhcp" update: true # - name: Add VM to HA group # community.proxmox.proxmox_cluster_ha_resources: # api_user: "{{ proxmox_user }}" # api_password: "{{ proxmox_password }}" # api_host: "{{ proxmox_host }}" # name: vm:"{{ vm_id }}" # state: "present" # group: "{{ ha_group }}" # max_relocate: 2 # max_restart: 2