voxpupuli / puppet-augeasproviders_ssh

Augeas-based ssh types and providers for Puppet
Apache License 2.0
7 stars 32 forks source link

Sshd_config[PubkeyAcceptedKeyTypes]: Could not evaluate: Failed to save Augeas tree to file. #99

Closed markdv77 closed 1 month ago

markdv77 commented 7 months ago

Affected Puppet, Ruby, OS and module versions/distributions

How to reproduce (e.g Puppet code you use)

Save this as sshd.pp:

sshd_config {
      'PubkeyAcceptedKeyTypes':
        ensure => present,
        #value  => [ '+ssh-dss' ];
        value  => '+ssh-dss';
}

Run using default sshd_config file:

cp /usr/share/openssh/sshd_config /etc/ssh/sshd_config
puppet apply sshd.pp

What are you seeing

Error: /Stage[main]/Main/Sshd_config[PubkeyAcceptedKeyTypes]: Could not evaluate: Failed to save Augeas tree to file. See debug logs for details.

Debug output shows:

Debug: Puppet::Type::Sshd_config::ProviderAugeas: Save failure details:
/augeas/files/etc/ssh/sshd_config/error/path = /files/etc/ssh/sshd_config/
/augeas/files/etc/ssh/sshd_config/error/lens = /opt/puppetlabs/puppet/share/augeas/lenses/dist/sshd.aug:154.12-.47:
/augeas/files/etc/ssh/sshd_config/error/message = Failed to match tree under /

     { "#comment" = "$OpenBSD: sshd_config,v 1.103 2018/04/09 20:41:22 tj Exp $" }
etc
  with pattern
etc.

Error: /Stage[main]/Main/Sshd_config[PubkeyAcceptedKeyTypes]: Could not evaluate: Failed to save Augeas tree to file. See debug logs for details.

What behaviour did you expect instead

I was hoping it would add the option to /etc/ssh/sshd_config

Output log

Any additional information you'd like to impart

tedgarb commented 6 months ago

Hi,

I think I fixed this in #65, which is not yet released. Could you confirm that the current HEAD works for you? I expect you will need to swap to the commented line for value in your code:

sshd_config {
      'PubkeyAcceptedKeyTypes':
        ensure => present,
        value  => [ '+ssh-dss' ];
        #value  => '+ssh-dss';
}
tedgarb commented 1 month ago

Hey, wanted to make sure you saw they released 7.0.0 which should fix this for you

markdv77 commented 1 month ago

Hi @tedgarb, nope I totally missed it. I've given it a quick go and it seems to be fixed indeed. Thank you very much for the reminder.👍