fix: apply the user-level settings for every human account, not just one - #65
Merged
Conversation
A box with more than one person on it only ever got the dotfiles for whoever was named. Everyone else got the system-wide half and nothing else -- no shell config, no ~/.cargo, no ~/.local/bin, no dconf, no container stacks -- and the run reported success either way. A desktop image with both a provisioning account and a real user is exactly that shape. install.sh now discovers the accounts and runs one pass per user. Discovery skips root, the system ranges (uid < 1000, the systemd range above 60000, shells of nologin/false/sync), and the cloud image's own account. That last one is read from system_info.default_user.name in /etc/cloud/cloud.cfg rather than matched by name, because it is `ubuntu` on an Ubuntu image and `cloud-user` on a Red Hat one; it exists to provision the machine, not to work in. `--users a,b` names any set instead, that account included. One pass per user rather than a loop inside the roles. There are roughly 350 user-scoped references across 49 files, so a per-task loop or a `user-scope` tag would eventually miss one silently -- which is the failure mode this area already has a history of. Looping the invocation cannot miss a task by construction, and the system-wide tasks are idempotent, so later passes no-op on everything except that user's own files. The playbook itself is unchanged: it still takes one hyperi_target_user per run. Anything driving ansible-playbook directly writes its own loop, which the docs now show. Verified on a real two-account host. With both accounts seeded to a 12h clock, a pass for each leaves both at 24h -- the second pass does not undo the first. Discovery returns `hyperi` on one box and `derek` on the other, correctly excluding `ubuntu` in both cases, and `tools/ci/run-tests.sh` is green.
…settings Falling back to whoever invoked the install would write dotfiles into root or the image's own provisioning account on exactly the machines the criteria exist to protect. Name the account with --users instead.
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.
A box with more than one person on it only ever got the dotfiles for whoever was named. Everyone else got the system-wide half and nothing else -- no shell config, no
~/.cargo, no~/.local/bin, no dconf, no container stacks -- and the run reported success either way. A desktop image with a provisioning account plus a real user is exactly that shape.install.shnow discovers the accounts and runs one pass per user.Who gets it
Skipped by default:
rootnologin/false/syncThat last one is read from
system_info.default_user.namein/etc/cloud/cloud.cfgrather than matched by name, because it isubuntuon an Ubuntu image andcloud-useron a Red Hat one.--users a,bnames any set instead, that account included.Why the loop is outside the roles
There are roughly 350 user-scoped references across 49 files. A per-task
loop, or auser-scopetag applied to each of them, would eventually miss one silently -- which is the failure mode this area already has a history of. Looping the invocation cannot miss a task by construction, and the system-wide tasks are idempotent, so later passes no-op on everything except that user's own files.The playbook is unchanged and still takes one
hyperi_target_userper run, so nothing about tag semantics moved. Anything drivingansible-playbookdirectly writes its own loop, which the docs now show.Verified
On a real two-account host, with both accounts seeded to a 12h clock:
hyperi->hyperimoves to 24hubuntu->ubuntumoves to 24h, andhyperiis still 24hso a later pass does not undo an earlier one. Discovery returns
hyperion one box andderekon the other, correctly excludingubuntuin both cases.tools/ci/run-tests.shgreen, shellcheck clean.