Fix SSH configuration indentation in cloud-init template #14837
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
indent(width=6, first=True)
toindent(width=6, first=False)
in cloud-init templateProblem
The SSH configuration file (
/etc/ssh/sshd_config
) was being written with 6 spaces of indentation on every line due to thefirst=True
parameter in the Jinja2 indent filter. This made the configuration file invalid, causing the SSH daemon to fail during startup and preventing connections on the configured port (4160).Solution
Removed the
first=True
parameter (equivalent tofirst=False
) from the indent filter to ensure the SSH configuration is written with proper formatting that sshd can parse.Test Plan
/etc/ssh/sshd_config
on the deployed server has correct formattingThis bug likely affects all cloud deployments that use cloud-init for initial configuration.
🤖 Generated with Claude Code