[PR #15] [MERGED] Remove legacy Ansible monolith — driver.run_fleet() is the entrypoint #15

Closed
opened 2026-06-03 09:01:11 +08:00 by ivenator1 · 0 comments
Owner

📋 Pull Request Information

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

Base: testingHead: claude/plan-remaining-tasks-Ry1tk


📝 Commits (10+)

  • a95585a Merge pull request #12 from ivenator1/testing
  • 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
  • b77b729 Merge pull request #13 from ivenator1/phase-4-vm-remote-node-flows

📊 Changes

109 files changed (+4281 additions, -5134 deletions)

View changed files

📝 .ansible-lint (+3 -15)
📝 .github/workflows/ci.yml (+8 -10)
📝 CLAUDE.md (+96 -129)
📝 README.md (+42 -43)
📝 ansible/primitives/reboot_host.yml (+1 -0)
📝 ansible/primitives/snapshot.yml (+7 -6)
📝 docs/migration-roadmap.md (+234 -63)
fleet-update.yml (+0 -387)
📝 hosts.ini.example (+5 -2)
proxmox_fleet/briefing.py (+117 -0)
📝 proxmox_fleet/changes.py (+42 -0)
📝 proxmox_fleet/cli.py (+38 -93)
📝 proxmox_fleet/driver.py (+398 -14)
📝 proxmox_fleet/executor.py (+4 -3)
proxmox_fleet/flows/node.py (+196 -0)
proxmox_fleet/flows/remote.py (+171 -0)
proxmox_fleet/flows/vm.py (+253 -0)
proxmox_fleet/history.py (+100 -0)
📝 proxmox_fleet/inventory.py (+123 -0)
📝 proxmox_fleet/models/settings.py (+34 -1)

...and 80 more files

📄 Description

Summary

Completes the Ansible→Python migration by removing the legacy monolith now that all phases are ported and proven in Python. driver.run_fleet() is the single end-to-end orchestrator the fleet-update CLI calls:

pre-flight proxy check → remote → custom → lxc → vm → node + manager → notify

It threads one in-memory FleetState through each phase (_merge_state() folds them together — the in-Python replacement for the old "Merge Python state" plays) and returns exit code 1 if any phase recorded a failure.

⚠️ This PR assumes live-hardware parity has been confirmed (per each phase's retire step in docs/migration-roadmap.md). It targets testing so the collapsed orchestrator can be validated on the real fleet before merging to main.

Removed

  • fleet-update.yml monolith and all skip_phase_* / --use-*-flow wiring
  • roles/{custom,lxc,vm,remote}_update tasks/ + defaults/ (logic lives in flows/*)
  • tasks/notify.yml, persist-history.yml, fleet-state-append.yml, check-window.yml (all ported to notifiers.py / history.py / models/state.py / window.py)
  • templates/discord_briefing.j2 (ported byte-for-byte to briefing.py)
  • tests/conftest.py Jinja shim + 15 Jinja-shim parity tests
  • Legacy-role molecule scenarios (lxc dry_run/rescue/stopped/template; vm; remote). The flow-driven scenarios (lxc normal/rollback/snapfail, custom ×6) remain.

Notable

  • Briefing parity is now locked by a captured golden fixture (tests/unit/data/briefing_golden.json, seeded from the live .j2 before deletion) instead of the Jinja shim — the byte-for-byte guarantee survives the template's removal.
  • CLI is now just fleet-update [--check] [-e key=val ...]driver.run_fleet().
  • Added run_fleet + _merge_state with unit tests (orchestration, merge, pre-flight abort).
  • CI repointed: ansible-lint / syntax-check now target ansible/primitives/; name[casing] demoted to a warning (primitives use lowercase action names).
  • Docs updated: README.md, CLAUDE.md, docs/migration-roadmap.md (status → complete).

Verification

  • pytest tests/unit/426 passed
  • python -m mypy proxmox_fleet/ → clean
  • yamllint . → clean
  • ansible-lint ansible/primitives/ → clean in CI (only local failure is community.proxmox not installable in the sandbox)

83 files changed, +362 / −5345.

https://claude.ai/code/session_01JcWxUwyK4NDGjx5WZKpaZm


Generated by 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/15 **Author:** [@ivenator1](https://github.com/ivenator1) **Created:** 6/3/2026 **Status:** ✅ Merged **Merged:** 6/3/2026 **Merged by:** [@ivenator1](https://github.com/ivenator1) **Base:** `testing` ← **Head:** `claude/plan-remaining-tasks-Ry1tk` --- ### 📝 Commits (10+) - [`a95585a`](https://github.com/ivenator1/proxmox-management/commit/a95585af9475896feabf45e6e97747e6516c4084) Merge pull request #12 from ivenator1/testing - [`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 - [`b77b729`](https://github.com/ivenator1/proxmox-management/commit/b77b7296a9921b238715f39d84c96e67d487ac48) Merge pull request #13 from ivenator1/phase-4-vm-remote-node-flows ### 📊 Changes **109 files changed** (+4281 additions, -5134 deletions) <details> <summary>View changed files</summary> 📝 `.ansible-lint` (+3 -15) 📝 `.github/workflows/ci.yml` (+8 -10) 📝 `CLAUDE.md` (+96 -129) 📝 `README.md` (+42 -43) 📝 `ansible/primitives/reboot_host.yml` (+1 -0) 📝 `ansible/primitives/snapshot.yml` (+7 -6) 📝 `docs/migration-roadmap.md` (+234 -63) ➖ `fleet-update.yml` (+0 -387) 📝 `hosts.ini.example` (+5 -2) ➕ `proxmox_fleet/briefing.py` (+117 -0) 📝 `proxmox_fleet/changes.py` (+42 -0) 📝 `proxmox_fleet/cli.py` (+38 -93) 📝 `proxmox_fleet/driver.py` (+398 -14) 📝 `proxmox_fleet/executor.py` (+4 -3) ➕ `proxmox_fleet/flows/node.py` (+196 -0) ➕ `proxmox_fleet/flows/remote.py` (+171 -0) ➕ `proxmox_fleet/flows/vm.py` (+253 -0) ➕ `proxmox_fleet/history.py` (+100 -0) 📝 `proxmox_fleet/inventory.py` (+123 -0) 📝 `proxmox_fleet/models/settings.py` (+34 -1) _...and 80 more files_ </details> ### 📄 Description ## Summary Completes the Ansible→Python migration by removing the legacy monolith now that all phases are ported and proven in Python. **`driver.run_fleet()` is the single end-to-end orchestrator** the `fleet-update` CLI calls: ``` pre-flight proxy check → remote → custom → lxc → vm → node + manager → notify ``` It threads one in-memory `FleetState` through each phase (`_merge_state()` folds them together — the in-Python replacement for the old "Merge Python state" plays) and returns exit code 1 if any phase recorded a failure. > ⚠️ This PR assumes live-hardware parity has been confirmed (per each phase's retire step in `docs/migration-roadmap.md`). It targets **`testing`** so the collapsed orchestrator can be validated on the real fleet before merging to `main`. ## Removed - `fleet-update.yml` monolith and all `skip_phase_*` / `--use-*-flow` wiring - `roles/{custom,lxc,vm,remote}_update` `tasks/` + `defaults/` (logic lives in `flows/*`) - `tasks/` — `notify.yml`, `persist-history.yml`, `fleet-state-append.yml`, `check-window.yml` (all ported to `notifiers.py` / `history.py` / `models/state.py` / `window.py`) - `templates/discord_briefing.j2` (ported byte-for-byte to `briefing.py`) - `tests/conftest.py` Jinja shim + 15 Jinja-shim parity tests - Legacy-role molecule scenarios (lxc `dry_run`/`rescue`/`stopped`/`template`; vm; remote). The flow-driven scenarios (lxc `normal`/`rollback`/`snapfail`, custom ×6) remain. ## Notable - **Briefing parity** is now locked by a captured golden fixture (`tests/unit/data/briefing_golden.json`, seeded from the live `.j2` before deletion) instead of the Jinja shim — the byte-for-byte guarantee survives the template's removal. - **CLI** is now just `fleet-update [--check] [-e key=val ...]` → `driver.run_fleet()`. - Added `run_fleet` + `_merge_state` with unit tests (orchestration, merge, pre-flight abort). - CI repointed: `ansible-lint` / `syntax-check` now target `ansible/primitives/`; `name[casing]` demoted to a warning (primitives use lowercase action names). - Docs updated: `README.md`, `CLAUDE.md`, `docs/migration-roadmap.md` (status → ✅ complete). ## Verification - `pytest tests/unit/` → **426 passed** - `python -m mypy proxmox_fleet/` → clean - `yamllint .` → clean - `ansible-lint ansible/primitives/` → clean in CI (only local failure is `community.proxmox` not installable in the sandbox) 83 files changed, +362 / −5345. https://claude.ai/code/session_01JcWxUwyK4NDGjx5WZKpaZm --- _Generated by [Claude Code](https://claude.ai/code/session_01JcWxUwyK4NDGjx5WZKpaZm)_ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
ivenator1 changed title from [PR #15] Remove legacy Ansible monolith — driver.run_fleet() is the entrypoint to [PR #15] [MERGED] Remove legacy Ansible monolith — driver.run_fleet() is the entrypoint 2026-06-03 10:01:08 +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#15
No description provided.