fix(terminfo): harden systems.configure.terminfo — no silent no-op, sshd validate, required terminfo_hosts - #143
Open
t0kubetsu wants to merge 1 commit into
Open
fix(terminfo): harden systems.configure.terminfo — no silent no-op, sshd validate, required terminfo_hosts#143t0kubetsu wants to merge 1 commit into
t0kubetsu wants to merge 1 commit into
Conversation
Follow-up to #135 review feedback (superseded PR, comments carried over): - drop ignore_errors on the terminfo copy: stat the controller for /usr/share/terminfo/a/alacritty first, copy only when present, and emit an explicit skip warning otherwise — no more green no-op runs - add validate: 'sshd -t -f %s' to the sshd_config edit so a config that would not parse is never written - require terminfo_hosts (drop default('all')): scenario inventories carry proxmox/proxmox_cli groups, an implicit all would rewrite sshd config on the hypervisor and the deployer; matches the TARGET_GROUP pattern used by the other generic bundles Relates to range42/range42#227
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Hardens
bundles/generic/systems.configure.terminfo(merged via #141), addressing the review feedback that carried over from the superseded #135:ignore_errors: trueon the terminfo copy — the play nowstats/usr/share/terminfo/a/alacrittyon the controller first, copies only when present, and emits an explicit skip warning otherwise. Previously a headless controller without Alacritty produced a green run that installed nothing.validate: '/usr/sbin/sshd -t -f %s'to thesshd_configedit — a config that would not parse is never written, instead of surviving until the next full sshd restart and locking the host out.terminfo_hosts(dropdefault('all')) — scenario inventories carryproxmox/proxmox_cligroups, so a caller forgetting the var would rewrite sshd config on the hypervisor and the deployer. Matches theTARGET_GROUPpattern used by the othergeneric/bundles. The only existing caller (admin_services_labstage_01) already passes it explicitly.README.mdandbundle_parametersupdated to match (default_where: call-site, no default); JSON regenerated withbundles/_tools/generate-bundle-params.py.cc @pparage — this picks up your non-blocking findings from #135.
Relates to range42/range42#227.
Not addressed (deliberate)
insertafter: '^AcceptEnv LANG LC_\*'can still fall back to EOF and land inside a trailingMatchblock on exotic configs. Moving to an/etc/ssh/sshd_config.d/drop-in would sidestep it, but that changes the bundle's editing strategy — left for a separate change if it bites.Test plan
ansible-playbook --syntax-check(ansible-core,-e terminfo_hosts=<group>) — passansible-lint— the previousignore-errorsviolation is gone; the remaining standalonesyntax-check[specific]complaint about the undefinedhostsvar is shared by every templated-hosts bundle in the repo (no lint CI configured)admin_services_labstage_01 against the lab; confirm skip warning appears when the controller lacks the terminfo entry, and the copy + sshd reload work when it does