This commit is contained in:
2025-09-26 11:55:32 -05:00
parent e7f8fd2ccd
commit 6107e474c1
34 changed files with 927 additions and 462 deletions

View File

@@ -0,0 +1,31 @@
---
- 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