Check if ha_peer is set or exit.

This commit is contained in:
2026-04-29 13:11:07 -07:00
parent 2855c111b2
commit 95e2dcafe8

View File

@@ -5,6 +5,17 @@
# ha_role: backup → minimal pre-checks, upgrade proceeds normally
# ha_role: primary → full CARP state verification, forced demotion
# Exit early if HA not needed
- name: "[CARP] Exit - No HA configured"
ansible.builtin.meta: end_play
when: ha_peer is not defined or ha_peer | length == 0
# Exit early if no upgrade available
- name: "[CARP] Exit - No upgrade available for this host"
ansible.builtin.meta: end_play
when: not (upgrade_available | default(false) | bool)
# ---------------------------------------------------------------------------
# Backup node logic — runs on the backup before it upgrades
# ---------------------------------------------------------------------------