testing new proxmox logic

This commit is contained in:
Semaphore
2026-03-15 15:48:59 -07:00
parent 347a85b09d
commit ea2f00c098
34 changed files with 2391 additions and 21 deletions

View File

@@ -0,0 +1,82 @@
---
# =============================================================================
# proxmox_reboot_node_loop.yml
# Called once per node by proxmox_reboot.yml
# =============================================================================
- name: "Reboot | {{ current_node }} | Start"
ansible.builtin.debug:
msg: "━━━ Starting reboot of node {{ current_node }} ━━━"
- name: "Reboot | {{ current_node }} | Set CEPH noout"
ansible.builtin.include_role:
name: proxmox_ceph
vars:
ceph_action: set_noout
- name: "Reboot | {{ current_node }} | Enable HA maintenance"
ansible.builtin.include_role:
name: proxmox_ha
vars:
ha_action: disable
- name: "Reboot | {{ current_node }} | Drain guests"
ansible.builtin.include_role:
name: proxmox_drain
- name: "Reboot | {{ current_node }} | Reboot"
ansible.builtin.reboot:
reboot_timeout: "{{ reboot_timeout }}"
msg: "{{ reboot_reason }}"
pre_reboot_delay: 5
post_reboot_delay: 15
delegate_to: "{{ current_node }}"
- name: "Reboot | {{ current_node }} | Wait for cluster rejoin"
community.proxmox.proxmox_node_info:
api_host: "{{ api_host }}"
api_user: "{{ api_user }}"
api_token_id: "{{ api_token_id }}"
api_token_secret: "{{ api_token_secret }}"
api_port: "{{ api_port | default(8006) }}"
validate_certs: "{{ validate_certs | default(false) }}"
register: reboot_rejoin_check
delegate_to: localhost
until: >-
reboot_rejoin_check.proxmox_nodes
| selectattr('node', 'equalto', current_node)
| selectattr('status', 'equalto', 'online')
| list
| length > 0
retries: "{{ node_rejoin_retries }}"
delay: "{{ node_rejoin_delay }}"
- name: "Reboot | {{ current_node }} | Back online"
ansible.builtin.debug:
msg: "✓ Node {{ current_node }} has rejoined the cluster after reboot."
- name: "Reboot | {{ current_node }} | Clear CEPH noout"
ansible.builtin.include_role:
name: proxmox_ceph
vars:
ceph_action: clear_noout
- name: "Reboot | {{ current_node }} | Disable HA maintenance"
ansible.builtin.include_role:
name: proxmox_ha
vars:
ha_action: enable
- name: "Reboot | {{ current_node }} | Restore guests"
ansible.builtin.include_role:
name: proxmox_restore
when: migration_restore | bool
- name: "Reboot | {{ current_node }} | Skip restore"
ansible.builtin.debug:
msg: "migration_restore=false — guests remain on their current nodes."
when: not migration_restore | bool
- name: "Reboot | {{ current_node }} | Complete"
ansible.builtin.debug:
msg: "━━━ Reboot complete: {{ current_node }} ━━━"