feat(proxmox): add k3s agents and refine VM provisioning

Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
This commit is contained in:
Tuan-Dat Tran
2025-07-12 23:08:44 +02:00
parent 609e000089
commit dac0d88d60
7 changed files with 102 additions and 141 deletions

View File

@@ -33,29 +33,12 @@
vmid: "{{ vm.vmid }}"
state: started
- name: Stop VM
community.general.proxmox_kvm:
api_user: "{{ proxmox_api_user }}@pam"
api_token_id: "{{ proxmox_api_token_id }}"
api_token_secret: "{{ proxmox_api_token_secret }}"
api_host: "192.168.20.12"
node: "{{ vm.node }}"
vmid: "{{ vm.vmid }}"
state: stopped
force: true
- name: Retry stopping VM
ansible.builtin.include_tasks: ./57_stop_and_verify_vm.yml
- name: Wait until VM is fully stopped
community.general.proxmox_vm_info:
api_user: "{{ proxmox_api_user }}@pam"
api_token_id: "{{ proxmox_api_token_id }}"
api_token_secret: "{{ proxmox_api_token_secret }}"
api_host: "192.168.20.12"
node: "{{ vm.node }}"
vmid: "{{ vm.vmid }}"
register: vm_status_check
until: vm_status_check.proxmox_vms[0].status == "stopped"
retries: 24
delay: 5
- name: Pause for 5 seconds for api
ansible.builtin.pause:
seconds: 5
- name: Start VM
community.general.proxmox_kvm: