Update roles/proxmox_upgrade/tasks/preflight.yml

This commit is contained in:
2026-03-14 15:36:32 -07:00
parent 47c36b6f6b
commit 8e72d3fec0

View File

@@ -2,8 +2,6 @@
# ============================================================================= # =============================================================================
# proxmox_upgrade — preflight.yml # proxmox_upgrade — preflight.yml
# Cluster health check before starting any upgrade work # Cluster health check before starting any upgrade work
# pvecm runs on the node directly (SSH) — no delegation needed
# API node check runs delegate_to: localhost via community.proxmox
# ============================================================================= # =============================================================================
- name: Preflight | Check quorum via pvecm - name: Preflight | Check quorum via pvecm
@@ -12,11 +10,11 @@
register: quorum_check register: quorum_check
changed_when: false changed_when: false
failed_when: quorum_check.rc != 0 failed_when: quorum_check.rc != 0
run_once: true
- name: Preflight | Get all cluster nodes via API - name: Preflight | Get all cluster nodes via API
community.proxmox.proxmox_node_info: community.proxmox.proxmox_node_info:
api_host: "{{ api_host }}" api_host: "{{ api_host }}"
api_user: "{{ api_user }}"
api_token_id: "{{ api_token_id }}" api_token_id: "{{ api_token_id }}"
api_token_secret: "{{ api_token_secret }}" api_token_secret: "{{ api_token_secret }}"
api_port: "{{ api_port }}" api_port: "{{ api_port }}"
@@ -41,7 +39,6 @@
ansible.builtin.shell: ceph health ansible.builtin.shell: ceph health
register: ceph_health register: ceph_health
changed_when: false changed_when: false
run_once: true
- name: Preflight | Abort if CEPH is in error state - name: Preflight | Abort if CEPH is in error state
ansible.builtin.fail: ansible.builtin.fail:
@@ -49,13 +46,11 @@
CEPH health check FAILED — {{ ceph_health.stdout }}. CEPH health check FAILED — {{ ceph_health.stdout }}.
Resolve CEPH issues before retrying. Resolve CEPH issues before retrying.
when: "'HEALTH_OK' not in ceph_health.stdout and 'HEALTH_WARN' not in ceph_health.stdout" when: "'HEALTH_OK' not in ceph_health.stdout and 'HEALTH_WARN' not in ceph_health.stdout"
run_once: true
- name: Preflight | Warn if CEPH has warnings - name: Preflight | Warn if CEPH has warnings
ansible.builtin.debug: ansible.builtin.debug:
msg: "WARNING — CEPH has warnings: {{ ceph_health.stdout }}. Proceeding but monitor closely." msg: "WARNING — CEPH has warnings: {{ ceph_health.stdout }}. Proceeding but monitor closely."
when: "'HEALTH_WARN' in ceph_health.stdout" when: "'HEALTH_WARN' in ceph_health.stdout"
run_once: true
- name: Preflight | Cluster health check passed - name: Preflight | Cluster health check passed
ansible.builtin.debug: ansible.builtin.debug:
@@ -64,3 +59,4 @@
quorum confirmed{{ ', CEPH checked' if ceph_enabled else '' }} quorum confirmed{{ ', CEPH checked' if ceph_enabled else '' }}
delegate_to: localhost delegate_to: localhost
run_once: true run_once: true