Skip to content
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

Subsystem setting broken with use_augeas => true #376

Closed
egrist opened this issue Feb 23, 2024 · 4 comments
Closed

Subsystem setting broken with use_augeas => true #376

egrist opened this issue Feb 23, 2024 · 4 comments

Comments

@egrist
Copy link

egrist commented Feb 23, 2024

Using module version 11.2.0.

First problem we notices was that when using use_augeas => true, $default_options is ignored.
A work around was to replace $options on line L78 in manifests/server.pp with deep_merge($default_options, $options). This enables defaults_options and the possibility to override them via the manifest or hieradata.

However, we got an error from Puppet::Type::Sshd_config::ProviderAugeas stating Ssh::Server::Config/Sshd_config[Subsystem]: Could not evaluate: Failed to save Augeas tree to file. See debug logs for details
Looking at the debug output I noticed /Subsystem/ missing from the pattern. Investigated further and found that in the
'puppet-augeasproviders_ssh', '6.0.0' this seems to be in another provider, sshd_config_subsystem as commented here, (not sure how to use the correct terminology, but hope it makes sense).

I'm not capable enough to conjure a solution, but maybe this info can help someone that hits the same issue. I'll just use the default use_augeas => false as a viable solution.

@saz
Copy link
Owner

saz commented May 18, 2024

Thanks for the detailed report. To get this working, subsystem must be handled differently in

$options.each |String $k, Hash $v| {
:

sshd_config_subsystem { "sftp":
  ensure  => present,
  command => "/usr/lib/openssh/sftp-server",
}

It might be enough to check if the key matches subsystem, split the value on and depending on the number of split results, pass it to sshd_config_subsystem

I'll try to come up with a PR

@saz
Copy link
Owner

saz commented May 23, 2024

@egrist This should be fixed with #386

Can you give it a try?

@egrist
Copy link
Author

egrist commented May 24, 2024

@saz Sorry but we've teared down that puppet environment about a month ago so I can't test it :(

@saz
Copy link
Owner

saz commented May 24, 2024

Thanks for the feedback. My change seems to be working, so I'll just merge it.

@saz saz closed this as completed in c2175e4 May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants