voxpupuli / puppet-firewalld

Puppet module for managing firewalld
Apache License 2.0
40 stars 77 forks source link

Missing dependency in metadata.json -- puppetlabs-augeas_core #315

Closed rychannel closed 1 year ago

rychannel commented 2 years ago

Affected Puppet, Ruby, OS and module versions/distributions

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

Unit test a module with a firewalld module dependency

What are you seeing

When doing unit testing on my own module, couldn't find Augeas resource in firewalld module.

What behaviour did you expect instead

Not to fail

Output log

Any additional information you'd like to impart

Add puppetlabs-augeas_core as a dependency in metadata.json . It's not currently listed, but fixed my unit test issue when I added it.

kenyon commented 2 years ago

We don't list core modules as dependencies in metadata.json. I can't find the explanation for this, maybe @bastelfreak can elaborate, I just know that we have answered this question before.

isc-lindensc commented 1 year ago

Hi,

think this is about error running a unit test against a custom module that contains latest firewalld as a fixture it results in: Puppet::PreformattedError: Evaluation Error: Resource type not found: Augeas (file: [redacted]/spec/fixtures/modules/firewalld/manifests/init.pp, line: 185, column: 3)

The issue is solved by adding augeas_core: "puppetlabs/augeas_core" into .fixtures under the forge modules section. This has todo with puppet removing augeas as builtin provider and bundling it only with puppet-agent.

https://puppet.com/docs/puppet/7/type.html#supported-type-modules-in-puppet-agent

bastelfreak commented 1 year ago

HI, sorry for the late reply, somehow this slipped through my inbox. @isc-lindensc is correct. the core packages are part of the AIO deb/rpm packages from Puppet, so modules can assume they are always present. Hence they should never be added to metadata.json. Adding them to fixtures.yml to pull them in during tests is correct.