homelab-codex-ws/scripts
Oskar Kapala eed0ad0635 fix(onboard): fix yaml_get fallback — strip inline comments and fix greedy colon match
Two bugs in the grep+sed fallback (triggered when yq is unavailable):

1. Greedy colon match: `s/.*: *//` consumed the *last* `: ` in the line, so
   values containing a colon (e.g. `systemd:magicmirror.service`) were
   silently truncated to the portion after the last colon.
   Fix: `s/^[[:space:]]*[^:]*:[[:space:]]*//' — anchored at line start,
   key chars are `[^:]*` (no colons), so only the first `: ` separator is removed.

2. Inline YAML comment not stripped: `first_contact: pi@pimirror2.local   # ...`
   returned the full tail including `#`, breaking callers like ssh-copy-id.
   Fix: add `s/[[:space:]]\+#.*$//` — requires at least one space before `#`
   to preserve bare `#` characters inside a value.

Also add leading/trailing whitespace trim as a separate pass.
Both bugs affect any node.yaml field that has an inline comment or a colon
in its value; all ten fields in hosts/lustro/node.yaml now parse correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 15:16:06 +02:00
..
bootstrap Implement VPS control-plane deployment profile 2026-05-12 20:19:05 +02:00
deploy feat(deploy): Saturn-side dispatcher wrapper 2026-06-03 16:06:36 +02:00
dev fix(dev): agent.sh worktree_count/paths grep exit-1 on empty set 2026-06-03 18:04:38 +02:00
lib Implement filesystem-first runtime event system 2026-05-12 13:38:25 +02:00
monitor feat(node-agent): implement health monitor and safe cleanup policy 2026-05-27 13:15:06 +02:00
observer fix(observer): robust incident lifecycle + orphan auto-resolve 2026-06-03 14:29:12 +02:00
onboard fix(onboard): fix yaml_get fallback — strip inline comments and fix greedy colon match 2026-06-08 15:16:06 +02:00
bootstrap.sh Initial homelab workspace structure 2026-05-07 20:17:27 +02:00