feat/prepare-rpi #280
Reference in New Issue
Block a user
No description provided.
Delete Branch "feat/prepare-rpi"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds a runnable example (
examples/fleet_rpi_setup) for onboarding an already-booted Raspberry Pi viaFleetDeviceSetupScore, plus the framework-level changes needed to make that flow clean.What's new
examples/fleet_rpi_setup— physical-device sibling offleet_vm_setup. No libvirt step; SSH straight to the Pi. Includesenv.shwith the standard secret-store / database-url variables.FleetDeviceSetupScore— reads the existing/etc/fleet-agent/config.toml, shows a unified diff against the desired one, prompts before overwriting.sudo -n trueprobe) and fetches the password throughSecretManager::get_or_prompt::<SudoPassword>()(cached after first prompt). Ansible gets it viaANSIBLE_BECOME_PASSWORD_FILE(path in env, neverargv); direct
ssh_execsudo paths usesudo -Swith the password piped through a newstdin: Option<&str>onssh_exec.FileFetchercapability trait +SudoPasswordSecret type.Score UX (FleetDeviceSetupScore)
[FleetSetup/<device>] Step N/7 — …).Outcome.detailsrecap surfaced as a bullet list under🚀 All done!viaharmony_cli's standard reporter — no bespoke renderer in the example.Framework-level fixes (apply to every score)
fix(linux)ensure_user_unit_activewas unconditionallyCHANGED; now probesis-enabled+is-activeand reportsNOOPcorrectly.fix(cli)cli_reporterwas filtering outNOOPdetails, dropping the recap on idempotent re-runs.fix(linux)drops the redundant(ansible-exit=…, stderr=…, stdout=…)envelope whenparse_erralready carries the message.Behavior unchanged
Default passwordless-sudo flow is identical to before — the probe runs first and only triggers the prompt on hosts that need it. SSH auth is still key-only; password-based SSH login is documented as a planned future extension (TODO on
SshCredentials).New first step (1/7): read /etc/fleet-agent/config.toml off the device and compare against the rendered desired config. Three branches: - missing → info, first install - matches → warn, converge anyway - differs → warn + unified diff (similar::TextDiff with 2-line context radius, '-/+' marker style) + inquire::Confirm prompt defaulting to N. Aborts with InterpretError if declined. Existing 6 steps renumbered to 2/7-7/7. The diff replaces the previous "dump both full configs" approach which was unreadable even for one-line differences. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>