-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove blank lines in rendered ssh_config and sshd_config #148
Comments
@johnnybubonic I haven't made any contributions to this repo so I can only speak in general. My inclination is to agree with the points you are raising but I've recently been made aware of a situation which complicates things. It started with an issue and PR in the
The problem was that a fix for some is a whitespace bomb for others -- as I mentioned in my comment regarding the fix. This led back to a stale issue in the main repo. After various discussions, that issue has been re-opened, so hopefully we can attain consistency when making fixes such as the ones you are suggesting. |
@myii Thanks for bringing that upstream issue to my attention re: per-file trimming etc. I've subscribed to it to follow. It's a good thing SSH doesn't have whitespace-dependent parsing! I can only imagine the headache for things that do. I think a lot of it - at least for this issue, for openssh-formula - can be addressed by just getting rid of the majority if not all of the macros. They're superfluous - many times they're used where simple for-loops could just be used instead with raw whitespacing in the template rather than trying to macro out the whitespacing/indentation and linebreaking. It seems to largely be an unnecessary complication. Alternatively, changing to something like a raw py template instead would probably be a lot more elegant. |
or one could just use the augeas state instead. |
@johnnybubonic If the resulting template is generally easier to understand, I'll be happy to merge your PR. Please stick to SLS. While it may not always be as elegant as Python, it lowers the bar for contributions. |
sure - i'll try to get a PR in. not sure when that'll be exactly (i'm.. in the middle of converting our infra over to salt, obviously...), but i'll keep it to SLS. would you be OK with using the augeaus state in addition/instead? it should be part of salt core. |
@johnnybubonic AFAIK augeas needs additional python libraries on the minion. Therefore I (and I think others) favor SLS templates. Have a look at https://github.com/saltstack-formulas/systemd-formula/blob/master/TOFS_pattern.md too, if you want to use alternative template files. |
The conf files you generate are either broken or render to eyesores such as this:
Yes, including trailing whitespace.
I'd remove the blank lines between UsePAM/AllowUsers/AllowGroups, and remove the blank lines between all items in the Match section as well as the trailing blank lines. These blank lines make the config harder to visually parse, as they are separating logical sections that should be together.
The text was updated successfully, but these errors were encountered: