Files

40 lines
1.3 KiB
YAML

---
# =============================================================================
# proxmox_upgrade.yml — Rolling Proxmox cluster upgrade
# =============================================================================
# Requires: community.proxmox collection + proxmoxer>=2.0, requests on Semaphore
# ansible-galaxy collection install community.proxmox
# pip install proxmoxer requests --break-system-packages
#
# Usage:
# ansible-playbook playbooks/proxmox_upgrade.yml \
# -i inventories/client_local_eng/hypervisor_hosts.yml
#
# Overrides:
# -e migration_bulk=true
# -e live_migrate_fallback=skip
# -e migration_restore=true
# =============================================================================
- name: Proxmox Rolling Upgrade
hosts: proxmox_cluster
gather_facts: true
serial: 1
run_once: true
pre_tasks:
- name: Validate upgrade_order is defined
ansible.builtin.fail:
msg: "upgrade_order must be defined in hypervisor_hosts.yml"
when: upgrade_order is not defined or upgrade_order | length == 0
- name: Log upgrade plan
ansible.builtin.debug:
msg: >-
Proxmox upgrade: {{ client_name }} ({{ client_id }})
Nodes: {{ upgrade_order | join(', ') }}
API: https://{{ api_host }}:{{ api_port }}
roles:
- proxmox_upgrade