Compare commits
2 Commits
0a52e32f42
...
b2379e597e
| Author | SHA1 | Date | |
|---|---|---|---|
| b2379e597e | |||
| ac3859047c |
15
roles/proxmox-lxc-provision/tasks/check-exists.yml
Normal file
15
roles/proxmox-lxc-provision/tasks/check-exists.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
- name: Query Proxmox for existing LXCs
|
||||
community.proxmox.proxmox_lxc_info:
|
||||
<<: "{{ proxmox_api_connection }}"
|
||||
register: proxmox_lxcs
|
||||
|
||||
- name: Check if LXC with hostname already exists
|
||||
ansible.builtin.set_fact:
|
||||
lxc_exists: >-
|
||||
{{
|
||||
proxmox_lxcs.proxmox_lxcs
|
||||
| selectattr('name', 'equalto', lxc_hostname)
|
||||
| list
|
||||
| length > 0
|
||||
}}
|
||||
Reference in New Issue
Block a user