fix: change proxmox info module to proxmox_vm_info from proxmox_lxc_info

This commit is contained in:
2026-04-14 17:52:24 -04:00
parent 3a2b4b8775
commit 6e6bed6a40
2 changed files with 4 additions and 3 deletions

View File

@@ -1,13 +1,14 @@
--- ---
- name: Query Proxmox for existing LXCs - name: Query Proxmox for existing LXCs
community.proxmox.proxmox_lxc_info: {} community.proxmox.proxmox_vm_info:
type: lxc
register: proxmox_lxcs register: proxmox_lxcs
- name: Check if LXC with hostname already exists - name: Check if LXC with hostname already exists
ansible.builtin.set_fact: ansible.builtin.set_fact:
lxc_exists: >- lxc_exists: >-
{{ {{
proxmox_lxcs.proxmox_lxcs proxmox_lxcs.proxmox_vms
| selectattr('name', 'equalto', lxc_hostname) | selectattr('name', 'equalto', lxc_hostname)
| list | list
| length > 0 | length > 0

View File

@@ -9,7 +9,7 @@
api_token_secret: "{{ proxmox_api_token_secret }}" api_token_secret: "{{ proxmox_api_token_secret }}"
validate_certs: "{{ proxmox_api_validate_certs }}" validate_certs: "{{ proxmox_api_validate_certs }}"
node: "{{ proxmox_node }}" node: "{{ proxmox_node }}"
community.proxmox.proxmox_lxc_info: *proxmox_defaults community.proxmox.proxmox_vm_info: *proxmox_defaults
block: block:
- name: Check if container exists - name: Check if container exists
community.proxmox.proxmox: community.proxmox.proxmox: