testing new proxmox logic
This commit is contained in:
68
playbooks/tasks/proxmox_upgrade_node_loop.yml
Normal file
68
playbooks/tasks/proxmox_upgrade_node_loop.yml
Normal file
@@ -0,0 +1,68 @@
|
||||
---
|
||||
# =============================================================================
|
||||
# proxmox_upgrade_node_loop.yml
|
||||
# Called once per node by proxmox_upgrade.yml.
|
||||
# Handles the full per-node upgrade pipeline in cluster mode.
|
||||
# =============================================================================
|
||||
|
||||
- name: "Node {{ current_node }} | Start"
|
||||
ansible.builtin.debug:
|
||||
msg: "━━━ Starting upgrade of node {{ current_node }} ━━━"
|
||||
|
||||
# ── Step 1: Backup config ─────────────────────────────────────────────────────
|
||||
- name: "Node {{ current_node }} | Step 1 — Backup config"
|
||||
ansible.builtin.include_role:
|
||||
name: proxmox_config_backup
|
||||
|
||||
# ── Step 2: CEPH noout ────────────────────────────────────────────────────────
|
||||
- name: "Node {{ current_node }} | Step 2 — Set CEPH noout"
|
||||
ansible.builtin.include_role:
|
||||
name: proxmox_ceph
|
||||
vars:
|
||||
ceph_action: set_noout
|
||||
|
||||
# ── Step 3: HA maintenance mode ───────────────────────────────────────────────
|
||||
- name: "Node {{ current_node }} | Step 3 — Enable HA maintenance"
|
||||
ansible.builtin.include_role:
|
||||
name: proxmox_ha
|
||||
vars:
|
||||
ha_action: disable
|
||||
|
||||
# ── Step 4: Drain guests ──────────────────────────────────────────────────────
|
||||
- name: "Node {{ current_node }} | Step 4 — Drain guests"
|
||||
ansible.builtin.include_role:
|
||||
name: proxmox_drain
|
||||
|
||||
# ── Step 5: Upgrade ───────────────────────────────────────────────────────────
|
||||
- name: "Node {{ current_node }} | Step 5 — Upgrade packages"
|
||||
ansible.builtin.include_role:
|
||||
name: proxmox_upgrade_node
|
||||
|
||||
# ── Step 6: Clear CEPH noout ──────────────────────────────────────────────────
|
||||
- name: "Node {{ current_node }} | Step 6 — Clear CEPH noout"
|
||||
ansible.builtin.include_role:
|
||||
name: proxmox_ceph
|
||||
vars:
|
||||
ceph_action: clear_noout
|
||||
|
||||
# ── Step 7: Resume HA management ─────────────────────────────────────────────
|
||||
- name: "Node {{ current_node }} | Step 7 — Disable HA maintenance"
|
||||
ansible.builtin.include_role:
|
||||
name: proxmox_ha
|
||||
vars:
|
||||
ha_action: enable
|
||||
|
||||
# ── Step 8: Restore guests (optional) ────────────────────────────────────────
|
||||
- name: "Node {{ current_node }} | Step 8 — Restore guests"
|
||||
ansible.builtin.include_role:
|
||||
name: proxmox_restore
|
||||
when: migration_restore | bool
|
||||
|
||||
- name: "Node {{ current_node }} | Skip restore"
|
||||
ansible.builtin.debug:
|
||||
msg: "migration_restore=false — guests remain on their current nodes."
|
||||
when: not migration_restore | bool
|
||||
|
||||
- name: "Node {{ current_node }} | Complete"
|
||||
ansible.builtin.debug:
|
||||
msg: "━━━ Node {{ current_node }} upgrade complete ━━━"
|
||||
Reference in New Issue
Block a user