well,
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 0s

This commit is contained in:
hogweed1
2026-11-04 21:01:24 +10:00
parent cb7e9006b9
commit e48ff30f50

View File

@@ -17,24 +17,16 @@
default_domain: "local"
tasks:
# === Автоматическое получение свободного VM ID ===
- name: Get next free VM ID from Proxmox
ansible.builtin.uri:
url: "https://{{ target_node }}:8006/api2/json/cluster/nextid"
method: GET
headers:
# Токен передается в специальном формате для Proxmox API
Authorization: "PVEAPIToken={{ pve_token_id }}={{ pve_token_secret }}"
#user: "{{ pve_user }}"
#password: "{{ pve_password }}"
#force_basic_auth: false
validate_certs: false
register: nextid_response
# === Получение свободного ID через локальную утилиту Proxmox ===
- name: Get next free VM ID via pvesh
ansible.builtin.command: "pvesh get /cluster/nextid"
register: pvesh_nextid
changed_when: false
when: vm_id is not defined
- name: Set VM ID variable
ansible.builtin.set_fact:
allocated_id: "{{ vm_id if vm_id is defined else nextid_response.json.data }}"
allocated_id: "{{ vm_id if vm_id is defined else pvesh_nextid.stdout | trim }}"
# === Вариант 1: Создание VM (Qemu) ===
# - name: Create Proxmox KVM (VM)