4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: CI

on:
pull_request:
schedule:
- cron: '4 4 * * *'


concurrency:
Expand All @@ -14,7 +12,7 @@ concurrency:
jobs:
puppet:
name: Puppet
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v1
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v2
with:
pidfile_workaround: 'false'
rubocop: false
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ vendor/
.ruby-*

## rspec
spec/fixtures/
spec/fixtures/manifests
spec/fixtures/modules
junit/

## Puppet module
Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Changelog

## [24.0.0](https://github.com/theforeman/puppet-foreman/tree/24.0.0) (2023-11-14)

[Full Changelog](https://github.com/theforeman/puppet-foreman/compare/23.2.0...24.0.0)

**Breaking changes:**

- Drop deprecated non-namespaced functions [\#1141](https://github.com/theforeman/puppet-foreman/pull/1141) ([ekohl](https://github.com/ekohl))
- Fixes [\#36801](https://projects.theforeman.org/issues/36801): Make Redis the default cache type [\#1134](https://github.com/theforeman/puppet-foreman/pull/1134) ([ehelms](https://github.com/ehelms))
- require puppetlabs/stdlib 9.x [\#1125](https://github.com/theforeman/puppet-foreman/pull/1125) ([bastelfreak](https://github.com/bastelfreak))

**Implemented enhancements:**

- Mark compatible with puppetlabs/postgresql 10.x [\#1143](https://github.com/theforeman/puppet-foreman/pull/1143) ([ekohl](https://github.com/ekohl))
- Use JSON to parse Foreman API responses [\#1142](https://github.com/theforeman/puppet-foreman/pull/1142) ([ekohl](https://github.com/ekohl))
- Include settings header via concat [\#1140](https://github.com/theforeman/puppet-foreman/pull/1140) ([ekohl](https://github.com/ekohl))
- Add Puppet 8 support [\#1139](https://github.com/theforeman/puppet-foreman/pull/1139) ([ekohl](https://github.com/ekohl))
- Mark compatible with puppet-extlib 7.x [\#1138](https://github.com/theforeman/puppet-foreman/pull/1138) ([ekohl](https://github.com/ekohl))
- Fixes [\#36090](https://projects.theforeman.org/issues/36090) - Support REX cockpit removal [\#1111](https://github.com/theforeman/puppet-foreman/pull/1111) ([ekohl](https://github.com/ekohl))

## [23.2.0](https://github.com/theforeman/puppet-foreman/tree/23.2.0) (2023-10-10)

[Full Changelog](https://github.com/theforeman/puppet-foreman/compare/23.1.0...23.2.0)
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ More filter info available [here](https://relishapp.com/rspec/rspec-core/v/3-9/d
To run OS specific tests:

```shell
SPEC_FACTS_OS=redhat-7-x86_64 bundle exec rspec spec/classes/foreman_spec.rb
SPEC_FACTS_OS=redhat-8-x86_64 bundle exec rspec spec/classes/foreman_spec.rb
```

If you have more than one version of `redhat` OS specified in metadata.json,
Expand Down
18 changes: 5 additions & 13 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,18 @@

source 'https://rubygems.org'

gem 'puppet', ENV['PUPPET_GEM_VERSION'] || '>= 5.5', groups: ['development', 'test']
gem 'puppet', ENV.fetch('PUPPET_GEM_VERSION', '>= 7'), groups: ['development', 'test']
gem 'rake'

gem 'kafo_module_lint', {"groups"=>["test"]}
gem 'puppet-lint-empty_string-check', {"groups"=>["test"]}
gem 'puppet-lint-file_ensure-check', {"groups"=>["test"]}
gem 'puppet-lint-param-docs', '>= 1.3.0', {"groups"=>["test"]}
gem 'puppet-lint-spaceship_operator_without_tag-check', {"groups"=>["test"]}
gem 'puppet-lint-strict_indent-check', {"groups"=>["test"]}
gem 'puppet-lint-undef_in_function-check', {"groups"=>["test"]}
gem 'voxpupuli-test', '~> 5.0', {"groups"=>["test"]}
gem 'puppet-lint-spaceship_operator_without_tag-check', '~> 1.0', {"groups"=>["test"]}
gem 'voxpupuli-test', '~> 7.0', {"groups"=>["test"]}
gem 'github_changelog_generator', '>= 1.15.0', {"groups"=>["development"]}
gem 'puppet_metadata', '~> 1.3'
gem 'puppet_metadata', '~> 3.3'
gem 'puppet-blacksmith', '>= 6.0.0', {"groups"=>["development"]}
gem 'voxpupuli-acceptance', '~> 1.0', {"groups"=>["system_tests"]}
gem 'voxpupuli-acceptance', '~> 2.0', {"groups"=>["system_tests"]}
gem 'puppetlabs_spec_helper', {"groups"=>["system_tests"]}
gem 'webmock', '~> 2.0'
gem 'oauth'

# Pin rdoc to prevent updating bundled psych (https://github.com/ruby/rdoc/commit/ebe185c8775b2afe844eb3da6fa78adaa79e29a4)
gem 'rdoc', '< 6.4'

# vim:ft=ruby
4 changes: 2 additions & 2 deletions lib/puppet/functions/foreman/foreman.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def foreman(item, search, per_page = "20", foreman_url = "https://localhost", fo
if use_tfmproxy
configfile = '/etc/foreman-proxy/settings.yml'
configfile = use_tfmproxy if use_tfmproxy.is_a? String
raise Puppet::ParseError, "File #{configfile} not found while use_tfmproxy is enabled" unless File.exists?(configfile)
raise Puppet::ParseError, "File #{configfile} not found while use_tfmproxy is enabled" unless File.exist?(configfile)
tfmproxy = YAML.load(File.read(configfile))
uri = URI.parse(tfmproxy[:foreman_url])
http = Net::HTTP.new(uri.host, uri.port)
Expand All @@ -87,7 +87,7 @@ def foreman(item, search, per_page = "20", foreman_url = "https://localhost", fo
http.use_ssl = true if uri.scheme == 'https'
http.verify_mode = OpenSSL::SSL::VERIFY_NONE if http.use_ssl?
end
results = Timeout::timeout(timeout) { PSON.parse http.request(req).body }
results = Timeout::timeout(timeout) { JSON.parse http.request(req).body }
rescue Exception => e
raise Puppet::ParseError, "Failed to contact Foreman at #{foreman_url}: #{e}"
end
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/functions/foreman/smartvar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def smartvar(var, foreman_url = "http://foreman", foreman_user = "admin", forema
req['Accept'] = 'application/json'

begin
Timeout::timeout(5) { PSON.parse(http.request(req).body)["value"] }
Timeout::timeout(5) { JSON.parse(http.request(req).body)["value"] }
rescue Exception => e
raise Puppet::ParseError, "Failed to contact Foreman #{e}"
end
Expand Down
143 changes: 0 additions & 143 deletions lib/puppet/parser/functions/foreman.rb

This file was deleted.

41 changes: 0 additions & 41 deletions lib/puppet/parser/functions/smartvar.rb

This file was deleted.

5 changes: 5 additions & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@
}

foreman::settings_fragment { 'header.yaml':
content => template('foreman/_header.erb'),
order => '00',
}

foreman::settings_fragment { 'base.yaml':
content => template('foreman/settings.yaml.erb'),
order => '01',
}
Expand Down
2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@
Optional[Integer[0]] $foreman_service_puma_threads_min = undef,
Integer[0] $foreman_service_puma_threads_max = 5,
Optional[Integer[0]] $foreman_service_puma_workers = undef,
Hash[String, Any] $rails_cache_store = { 'type' => 'file' },
Hash[String, Any] $rails_cache_store = { 'type' => 'redis' },
Boolean $keycloak = false,
String[1] $keycloak_app_name = 'foreman-openidc',
String[1] $keycloak_realm = 'ssl-realm',
Expand Down
2 changes: 1 addition & 1 deletion manifests/plugin.pp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

if $config {
file { $config_file:
ensure => file,
ensure => bool2str($version == 'absent', 'absent', 'file'),
owner => $config_file_owner,
group => $config_file_group,
mode => $config_file_mode,
Expand Down
Loading