From 94f2e2ea0f109a555d1ffdd6aacfe41ea22be469 Mon Sep 17 00:00:00 2001 From: Simon Cornet Date: Fri, 30 May 2025 15:56:32 +0200 Subject: [PATCH] feat: exit maintenance mode in last play --- tasks/main.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tasks/main.yaml b/tasks/main.yaml index 7a499e4..1cc380e 100644 --- a/tasks/main.yaml +++ b/tasks/main.yaml @@ -8,12 +8,13 @@ # collect proxmox cluster nodes - name: "collect proxmox cluster nodes" set_fact: - leader_node: "{{ groups['proxmox'] | default([]) | first | default('') }}" + first_node: "{{ groups['proxmox'] | default([]) | first | default('') }}" + last_node: "{{ groups['proxmox'] | default([]) | last | default('') }}" # enter ceph maintenance mode - name: "set ceph enter maintenance mode" ansible.builtin.include_tasks: "ceph/enter-maint.yaml" - when: "inventory_hostname == leader_node" + when: "inventory_hostname == first_node" # update proxmox cluster - name: "update proxmox cluster nodes" @@ -22,4 +23,4 @@ # exit ceph maintenance mode - name: "exit ceph maintenance mode" ansible.builtin.include_tasks: "ceph/exit-maint.yaml" - when: "inventory_hostname == leader_node" + when: "inventory_hostname == last_node"