Repository navigation
docs(ansible): stop shipping ansible_user: root in the inventory template - #66
Merged
Merged
Conversation
…late With ansible_user unset, Ansible connects as the control machine's $USER, which is exactly the admin account baseline creates. The shipped `ansible_user: root` broke every host after its first converge (ssh_hardening disables root login) until the operator edited the inventory by hand, and it overrode `-u`. New hosts now bootstrap once with `make deploy LIMIT=<host> ANSIBLE_ARGS='-u root'`; later runs need no flag. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Unresolved documentation issues could cause bootstrap failures on supported host configurations.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 2
Open (2)
What changed in this PR
Updates Ansible documentation and the inventory template to stop defaulting connections to root after bootstrap.
Changes:
- Removes the shipped
ansible_user: root. - Documents bootstrap with the image’s actual bootstrap account.
- Clarifies post-bootstrap
ansible_userconfiguration.
| File | Summary | Findings |
|---|---|---|
ansible/README.md |
Documents bootstrap and subsequent deployment behavior. | Moderate findings: clarify replacing root with the image’s bootstrap user and leaving explicit admin settings unset until after bootstrap. Nit: qualify later runs as occurring after a successful first converge. |
ansible/inventory/hosts.yml.example |
Removes the default root user and adds usage guidance. | Moderate finding: annotate the bootstrap command with the actual bootstrap user. Nit: mark the explicit admin setting as post-bootstrap. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…p user Also note that a per-host ansible_user must be added only after bootstrap, since it overrides -u on the first converge. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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
ansible_user: rootfrominventory/hosts.yml.example. With it unset, Ansible connects as your local$USER, which is the admin account baseline already creates (roles/baseline/tasks/main.yml, runner autodetect).make deploy LIMIT=<host> ANSIBLE_ARGS='-u root'(or the image's default sudo user). Later runs need no flag, so there's no inventory edit after the first converge.ansible_useris still needed: the admin name differs from$USER, orbaseline_sudo_autodetect_runner: false. They also warn against setting it to the bootstrap user, because an inventoryansible_useroverrides-u.Why: after the first converge,
ssh_hardeningdisabled root login, but the template still saidroot. Every host broke until someone edited the inventory by hand, and a fleet-widemake deployfailed on any host that was missed.No Makefile or role changes:
ANSIBLE_ARGSalready passes-uthrough.Test plan
ansible-inventory --host decdn-node-1on a.ymlcopy of the template: onlyansible_hostresolves.yamllint) on the template copy🤖 Generated with Claude Code