refactor: Update check-exists.yml to check by vmid or hostname
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user