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

puppet5.5: restore support and tests for puppet5.5 #2

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open

Conversation

b4ldr
Copy link
Owner

@b4ldr b4ldr commented Apr 16, 2021

run test

@b4ldr b4ldr force-pushed the puppet5.5 branch 4 times, most recently from 19350f9 to 5c020db Compare March 8, 2023 14:10
b4ldr and others added 9 commits June 22, 2023 18:18
Often custom resources only support present/absent for the ensure
parameter and often the inclusion of theses resources are enabled via
some boolean value as such i often find my self using the following
pattern

 $ensure_feature = $enable_feature.bool2str('ensure', 'present')

This patch updates the stdlib::ensure function so we can simplify this to

 $ensure_feature = $enable_feature.stdlib::ensure   # or ...
 $ensure_feature = stdlib::ensure($enable_feature)

Update spec/functions/stdlib_ensure_spec.rb

Co-authored-by: Ewoud Kohl van Wijngaarden <[email protected]>

Update spec/functions/stdlib_ensure_spec.rb

Co-authored-by: Ewoud Kohl van Wijngaarden <[email protected]>
In 657cd71 it was assumed that Etc
would never be available on Windows and that the LoadError would catch
it. Turns out that was an invalid assumption. This uses the safe
operator to gracefully handle it.

Fixes: 657cd71
GSPatton and others added 10 commits June 22, 2023 18:18
…iosuly the fixutre was configured to pull from main. Given the recent changes when moving towards puppet8 main is unsafe."
Since Puppet `7.23.0` `fqdn_rand` uses the modern structured
`networking` fact instead of the legacy `fqdn` fact.

In this commit we mock the new fact if using `7.23.0` or later.

This is a rebase of
puppetlabs#1294

and incorporates Aria Li's original change and a variation on Josh
Cooper's suggestion for keeping compatibility with Puppet < `7.23.0`
This unbreaks the breaking change made in puppetlabs#1196

Also refactored to create a separate dispatch method for the case when
`packages` is a `Hash`, and having that call the main `ensure_packages`
method. This simplifies the code by only ever calling `ensure_resource`
instead of calling `ensure_resources` for hashes.

Defaulting `default_attributes` to an empty hash instead of `nil` in the
method signatures further simplifies the code.

Fixes puppetlabs#1252
This PR creates new new resources:
 * Stdlib::Http::Method for validating http methods
 * Stdlib::Http::Status This is just a copy of Stdlib::Httpstatus
 * make Stdlib::Httpstatus and alias to Stdlib::Http::Status

Ideally we would deprecate Stdlib::Httpstatus in favour of
Stdlib::Http::Status

Co-authored-by: Ewoud Kohl van Wijngaarden <[email protected]>
* Github actions
  * Manually specify matrix for debian and puppet5.5
  * use ruby 2.5 by default for spec tests
  * drop lint/rubocop tests as puppetlabs can do this
* Gemfile
  * drop dependency of puppet-module-posix-* to '~> 0.0' for spec tests
  * drop puppet-module-win-*
  * use default puppet version of '~> 5.5.0'
* fixtures
  * force version of puppetlabs-puppet_agent so we can use puppet5
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

Successfully merging this pull request may close these issues.