voxpupuli / puppet-augeasproviders_ssh

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

Sshd.lns fails to parse Match block #56

Open vchepkov opened 4 years ago

vchepkov commented 4 years ago

While trying to apply the following code

  sshd_config { 'PermitRootLogin':
    value  => 'no',
  }

receive the following error message

Error: /Stage[main]/Ssh/Sshd_config[PermitRootLogin]: Could not evaluate: Augeas didn't load /etc/ssh/sshd_config with Sshd.lns from /opt/puppetlabs/puppet/cache/lib/augeas/lenses: Get did not match entire input (line:148, character:0)

The line 148 starts match block added by GitLab installer:

Match User git    # Apply the AuthorizedKeysCommands to the git user only
  AuthorizedKeysCommand /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-shell-authorized-keys-check git %u %k
  AuthorizedKeysCommandUser git
Match all    # End match, settings apply to all users again
vchepkov commented 4 years ago

@raphink , could you suggest a workaround, please?

derekmpage commented 2 years ago

Can anyone suggest a work around for this?

emperortomato commented 1 month ago

This is still an issue -- the lens seems to be tripped up by the Match all line, rather than the indentation or comments. Removing that line allows it to work, but that's not necessarily desirable, unless the Match User git block appears at the very end of the file (although it probably does).

This lens also seems incapable of creating a Match all line using the sshd_config_match resource, which gives an error:

Error: /Stage[main]/Profiles::Sshd/Sshd_config_match[all]: Could not evaluate: undefined method `keys' for nil:NilClass