Added step to remove default local-lvm

This commit is contained in:
Francesco Zimbolo
2026-04-23 08:18:34 +00:00
parent 20a3b0ab0e
commit 861a468fc7

View File

@@ -9,6 +9,24 @@
mode: '0600' mode: '0600'
when: inventory_hostname == groups['proxmox'][0] when: inventory_hostname == groups['proxmox'][0]
- name: Prevent Split-Brain by removing default local-lvm if managed by Linstor
ansible.builtin.shell: |
set -o pipefail
# Check if local-lvm is currently registered in Proxmox
if pvesm status | grep -q "^local-lvm "; then
pvesm remove local-lvm
echo "changed"
fi
args:
executable: /bin/bash
register: proxmox_storage_remove_local_lvm
changed_when: "'changed' in proxmox_storage_remove_local_lvm.stdout"
loop: "{{ linstor_storage_pools }}"
# Only run on Node 1, and ONLY if the loop detects the usage of the pve/data pool
when:
- inventory_hostname == groups['proxmox'][0]
- (item.vg_name == 'pve' and item.thin_name == 'data') or ('pve/data' in item.targets.values())
- name: Register LINSTOR resource groups in Proxmox GUI (pvesm) - name: Register LINSTOR resource groups in Proxmox GUI (pvesm)
ansible.builtin.shell: | ansible.builtin.shell: |
set -o pipefail set -o pipefail