Skip to content

Conversation

@traylenator
Copy link
Contributor

@traylenator traylenator commented Sep 1, 2025

This Pull Request (PR) fixes the following issues

Once the main class has been included:

include augeasproviders_ssh

type instances can be loaded from hiera data, for example:

augeasproviders_ssh::sshd_configs:
  AllowAgentForwarding:
    ensure: 'present'
    value: 'yes'
  PermitRootLogin:
    ensure: 'present'
    value: 'yes'

Once the main class has been included:

```puppet
include augeasproviders_ssh
````

type instances can be loaded from hiera data, for example:

```yaml
augeasproviders_ssh::sshd_configs:
  AllowAgentForwarding:
    ensure: 'present'
    value: 'yes',
  PermitRootLogin:
    ensure: 'present'
    value:  'yes'
```
@traylenator
Copy link
Contributor Author

Well the easy fix to the CI is #115

@traylenator traylenator added the enhancement New feature or request label Sep 1, 2025
@traylenator
Copy link
Contributor Author

Tests fixed but only by adding an unused hiera.yaml file ?


RSpec.configure do |c|
c.facterdb_string_keys = false
c.hiera_config = ''
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes me wonder if rspec-puppet itself should deal better with this. Relevant code: https://github.com/OpenVoxProject/openvox/blob/f70dd2111bed0be3ede7017c062df0edceb4ccd0/lib/puppet/indirector/hiera.rb#L80-L92

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see the problem at all running locally with rspec.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty string resulted in:

[#<Puppet::Util::Log:0x00007f117c545ff8 @level=:err, @tags=#<Puppet::Util::TagSet: {"err"}>, @message="Evaluation Error: Error while evaluating a Function Call, Is a directory @ io_fread - /home/runner/work/puppet-augeasproviders_ssh/puppet-augeasproviders_ssh", @source="Puppet", @time=2025-09-01 14:46:11.80255521 +0000, @line=2, @pos=1, @issue_code=:RUNTIME_ERROR, @node="pkrvmccyg1gnepe.h0l24wjbi32ehma3ntfoutcuxb.cx.internal.cloudapp.net">,

so that's a no.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "workaround" is now just a setting a for a hiera file that does not exist at all. Have added the .sync.yml to keep it there.
This is fairly resolved for me.

Without this v5 hiera yaml file:

```
+ #<Puppet::Util::Log:0x00007f1ed6e6f298 @Level=:warning, @tags=#<Puppet::Util::TagSet: {"warning"}>, @message="/dev/null: File exists but does not contain a valid YAML hash. Falling back to Hiera version 3 default config", @source="Puppet", @time=2025-09-01 12:40:08.763493772 +0000>,
+ #<Puppet::Util::Log:0x00007f1ed6e6f1a8 @Level=:warning, @tags=#<Puppet::Util::TagSet: {"warning"}>, @message="/dev/null: Use of 'hiera.yaml' version 3 is deprecated. It should be converted to version 5\n   (file: /dev/null)", @source="Puppet", @time=2025-09-01 12:40:08.763558543 +0000>,
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants