[PR #13] [MERGED] feat: Phase 4a — vm_update + remote_host_update Python flows #13

Closed
opened 2026-06-02 20:54:32 +08:00 by ivenator1 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ivenator1/proxmox-management/pull/13
Author: @ivenator1
Created: 6/2/2026
Status: Merged
Merged: 6/2/2026
Merged by: @ivenator1

Base: mainHead: phase-4-vm-remote-node-flows


📝 Commits (8)

  • 6510988 feat: Phase 4a — vm_update + remote_host_update Python flows
  • a794dec fix: VM rollback uses node_executor; HA-aware node discovery via pvesh
  • 405935d fix: use if/elif/else for pkg manager detection to avoid bash && || precedence bug
  • 8b68ee2 feat: add LXC/VM sub-headings in Discord briefing per node
  • 8995e66 feat: show package upgrade count for VMs in Discord briefing
  • dde870e fix: suppress pkg_count in dry-run — apt -s counts pending not upgraded
  • 2572b15 docs: update roadmap and CLAUDE.md for Phase 4a completion
  • 4a0f1f9 Merge branch 'main' into phase-4-vm-remote-node-flows

📊 Changes

22 files changed (+1941 additions, -61 deletions)

View changed files

📝 CLAUDE.md (+26 -5)
📝 ansible/primitives/snapshot.yml (+7 -6)
📝 docs/migration-roadmap.md (+95 -24)
📝 fleet-update.yml (+66 -12)
📝 hosts.ini.example (+5 -2)
📝 proxmox_fleet/changes.py (+42 -0)
📝 proxmox_fleet/cli.py (+38 -2)
📝 proxmox_fleet/driver.py (+206 -2)
📝 proxmox_fleet/executor.py (+4 -3)
proxmox_fleet/flows/remote.py (+171 -0)
proxmox_fleet/flows/vm.py (+253 -0)
📝 proxmox_fleet/inventory.py (+123 -0)
📝 proxmox_fleet/models/settings.py (+15 -0)
📝 proxmox_fleet/models/state.py (+2 -1)
📝 proxmox_fleet/status.py (+88 -0)
📝 roles/lxc_update/molecule/mol_run_flow.py (+1 -1)
📝 templates/discord_briefing.j2 (+2 -2)
📝 tests/unit/test_discord_briefing.py (+43 -1)
tests/unit/test_flow_remote.py (+253 -0)
tests/unit/test_flow_vm.py (+347 -0)

...and 2 more files

📄 Description

Summary

  • Ports vm_update and remote_host_update Ansible roles to Python flows (flows/vm.py, flows/remote.py) behind --use-vm-flow / --use-remote-flow flags — same flag-behind-a-flag pattern as Phases 2 and 3
  • Adds HA-aware VM node discovery via pvesh get /cluster/resources — live cluster state wins over static pve_node inventory hint so HA migrations are handled automatically
  • Two-executor pattern for VMs: vm_executor (VM SSH, for package upgrades) and node_executor (Proxmox node SSH, for qm rollback/qm status) — ensures rollback commands run on the correct host
  • Fixes bash &&/|| precedence bug in package manager detection that caused all echo branches to fire on Debian, making reversed() scan return apk instead of apt and silently skipping updates
  • Discord briefing: LXC and VM items grouped under - LXC / - VM sub-headings per node; VM format aligned with LXC style (name (id) — status); package upgrade count shown on real runs (UPDATED (3 upgraded)), suppressed on dry-runs
  • Docs: roadmap and CLAUDE.md updated with Phase 4a implementation notes, pitfalls, retire steps, and updated play order table

Test plan

  • Pull branch on Ansible manager LXC and activate venv
  • python -m pytest tests/unit/ -v — all tests green
  • fleet-update --use-vm-flow --use-remote-flow --check -e fleet_dry_run=true — compare output against legacy fleet-update --check -e fleet_dry_run=true
  • Real run with --use-vm-flow — confirm UPDATED (N upgraded) appears for VMs with pending packages
  • Retire legacy roles after live parity confirmed — separate commit per the retire steps in docs/migration-roadmap.md

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ivenator1/proxmox-management/pull/13 **Author:** [@ivenator1](https://github.com/ivenator1) **Created:** 6/2/2026 **Status:** ✅ Merged **Merged:** 6/2/2026 **Merged by:** [@ivenator1](https://github.com/ivenator1) **Base:** `main` ← **Head:** `phase-4-vm-remote-node-flows` --- ### 📝 Commits (8) - [`6510988`](https://github.com/ivenator1/proxmox-management/commit/6510988fe6eec84caa6d17709d480c3df64976f8) feat: Phase 4a — vm_update + remote_host_update Python flows - [`a794dec`](https://github.com/ivenator1/proxmox-management/commit/a794dec3069334be3aab5196eb02a218b0a529d2) fix: VM rollback uses node_executor; HA-aware node discovery via pvesh - [`405935d`](https://github.com/ivenator1/proxmox-management/commit/405935da50e0e531ed401fbf7e2cc1065e33b6f0) fix: use if/elif/else for pkg manager detection to avoid bash && || precedence bug - [`8b68ee2`](https://github.com/ivenator1/proxmox-management/commit/8b68ee2abc9eacf9ab23df133cf96a1b127d98a3) feat: add LXC/VM sub-headings in Discord briefing per node - [`8995e66`](https://github.com/ivenator1/proxmox-management/commit/8995e668a796a8b791e6ab2a277a92fdd39f4ecd) feat: show package upgrade count for VMs in Discord briefing - [`dde870e`](https://github.com/ivenator1/proxmox-management/commit/dde870e946526af796647d2d25461d3a7b91f13c) fix: suppress pkg_count in dry-run — apt -s counts pending not upgraded - [`2572b15`](https://github.com/ivenator1/proxmox-management/commit/2572b1520fcb9d8461717dfbdc84674c06f9b0d6) docs: update roadmap and CLAUDE.md for Phase 4a completion - [`4a0f1f9`](https://github.com/ivenator1/proxmox-management/commit/4a0f1f9f524d644891448b48e57d683244665552) Merge branch 'main' into phase-4-vm-remote-node-flows ### 📊 Changes **22 files changed** (+1941 additions, -61 deletions) <details> <summary>View changed files</summary> 📝 `CLAUDE.md` (+26 -5) 📝 `ansible/primitives/snapshot.yml` (+7 -6) 📝 `docs/migration-roadmap.md` (+95 -24) 📝 `fleet-update.yml` (+66 -12) 📝 `hosts.ini.example` (+5 -2) 📝 `proxmox_fleet/changes.py` (+42 -0) 📝 `proxmox_fleet/cli.py` (+38 -2) 📝 `proxmox_fleet/driver.py` (+206 -2) 📝 `proxmox_fleet/executor.py` (+4 -3) ➕ `proxmox_fleet/flows/remote.py` (+171 -0) ➕ `proxmox_fleet/flows/vm.py` (+253 -0) 📝 `proxmox_fleet/inventory.py` (+123 -0) 📝 `proxmox_fleet/models/settings.py` (+15 -0) 📝 `proxmox_fleet/models/state.py` (+2 -1) 📝 `proxmox_fleet/status.py` (+88 -0) 📝 `roles/lxc_update/molecule/mol_run_flow.py` (+1 -1) 📝 `templates/discord_briefing.j2` (+2 -2) 📝 `tests/unit/test_discord_briefing.py` (+43 -1) ➕ `tests/unit/test_flow_remote.py` (+253 -0) ➕ `tests/unit/test_flow_vm.py` (+347 -0) _...and 2 more files_ </details> ### 📄 Description ## Summary - Ports `vm_update` and `remote_host_update` Ansible roles to Python flows (`flows/vm.py`, `flows/remote.py`) behind `--use-vm-flow` / `--use-remote-flow` flags — same flag-behind-a-flag pattern as Phases 2 and 3 - Adds HA-aware VM node discovery via `pvesh get /cluster/resources` — live cluster state wins over static `pve_node` inventory hint so HA migrations are handled automatically - Two-executor pattern for VMs: `vm_executor` (VM SSH, for package upgrades) and `node_executor` (Proxmox node SSH, for `qm rollback`/`qm status`) — ensures rollback commands run on the correct host - Fixes bash `&&`/`||` precedence bug in package manager detection that caused all echo branches to fire on Debian, making `reversed()` scan return `apk` instead of `apt` and silently skipping updates - Discord briefing: LXC and VM items grouped under `- LXC` / `- VM` sub-headings per node; VM format aligned with LXC style (`name (id) — status`); package upgrade count shown on real runs (`UPDATED (3 upgraded)`), suppressed on dry-runs - Docs: roadmap and CLAUDE.md updated with Phase 4a implementation notes, pitfalls, retire steps, and updated play order table ## Test plan - [x] Pull branch on Ansible manager LXC and activate venv - [x] `python -m pytest tests/unit/ -v` — all tests green - [x] `fleet-update --use-vm-flow --use-remote-flow --check -e fleet_dry_run=true` — compare output against legacy `fleet-update --check -e fleet_dry_run=true` - [x] Real run with `--use-vm-flow` — confirm `UPDATED (N upgraded)` appears for VMs with pending packages - [ ] Retire legacy roles after live parity confirmed — separate commit per the retire steps in `docs/migration-roadmap.md` 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
ivenator1 2026-06-02 20:54:32 +08:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ivenator1/proxmox-management#13
No description provided.