refactor: Update check-exists.yml to check by vmid or hostname

This commit is contained in:
2026-04-14 19:08:28 -04:00
parent 9d7f702f2a
commit 441b9fa824
2 changed files with 7 additions and 11 deletions

View File

@@ -12,15 +12,12 @@
community.proxmox.proxmox_vm_info: *proxmox_defaults
block:
- name: Check if container exists
community.proxmox.proxmox:
vmid: "{{ lxc_vmid }}"
state: current
register: existing_container
ignore_errors: true
ansible.builtin.include_tasks:
file: check-exists.yml
- name: Skip if container already exists
meta: end_host
when: existing_container is succeeded
when: lxc_exists | bool
- name: Container source must be defined (lxc_clone_from or lxc_template)
ansible.builtin.fail: