11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## [19.2.0](https://github.com/theforeman/puppet-foreman/tree/19.2.0) (2022-02-04)

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

**Implemented enhancements:**

- puppet/extlib: Allow 6.x [\#1027](https://github.com/theforeman/puppet-foreman/pull/1027) ([bastelfreak](https://github.com/bastelfreak))
- Reflect Foreman 3.2+ support for Debian 11 [\#1025](https://github.com/theforeman/puppet-foreman/pull/1025) ([ekohl](https://github.com/ekohl))
- Explicitly enable the foreman dnf module on Foreman 3.2+ [\#1023](https://github.com/theforeman/puppet-foreman/pull/1023) ([evgeni](https://github.com/evgeni))
- Introduce foreman::settings\_fragment [\#1016](https://github.com/theforeman/puppet-foreman/pull/1016) ([ekohl](https://github.com/ekohl))

## [19.1.1](https://github.com/theforeman/puppet-foreman/tree/19.1.1) (2022-01-26)

[Full Changelog](https://github.com/theforeman/puppet-foreman/compare/19.1.0...19.1.1)
Expand Down
6 changes: 2 additions & 4 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
$websockets_ssl_cert = pick($foreman::websockets_ssl_cert, $foreman::server_ssl_cert)
$websockets_ssl_key = pick($foreman::websockets_ssl_key, $foreman::server_ssl_key)

concat::fragment {'foreman_settings+01-header.yaml':
target => '/etc/foreman/settings.yaml',
foreman::settings_fragment { 'header.yaml':
content => template('foreman/settings.yaml.erb'),
order => '01',
}
Expand Down Expand Up @@ -214,8 +213,7 @@
}
}

concat::fragment {'foreman_settings+02-authorize_login_delegation.yaml':
target => '/etc/foreman/settings.yaml',
foreman::settings_fragment { 'authorize_login_delegation.yaml':
content => template('foreman/settings-external-auth.yaml.erb'),
order => '02',
}
Expand Down
3 changes: 1 addition & 2 deletions manifests/config/apache.pp
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@
}

# This sets the headers matching what $vhost_https_internal_options sets
concat::fragment { 'foreman_settings+03-reverse-proxy-headers.yaml':
target => '/etc/foreman/settings.yaml',
foreman::settings_fragment { 'reverse-proxy-headers.yaml':
content => file('foreman/settings-reverse-proxy-headers.yaml'),
order => '03',
}
Expand Down
9 changes: 8 additions & 1 deletion manifests/repo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,14 @@
Foreman::Repos['foreman'] -> Package['centos-release-scl-rh']
}

if $facts['os']['release']['major'] == '8' and ($repo == 'nightly' or versioncmp($repo, '2.5') >= 0) {
if $facts['os']['release']['major'] == '8' and ($repo == 'nightly' or versioncmp($repo, '3.2') >= 0) {
package { 'foreman':
ensure => "el${facts['os']['release']['major']}",
enable_only => true,
provider => 'dnfmodule',
require => Foreman::Repos['foreman'],
}
} elsif $facts['os']['release']['major'] == '8' and versioncmp($repo, '2.5') >= 0 {
package { 'ruby':
ensure => '2.7',
enable_only => true,
Expand Down
20 changes: 20 additions & 0 deletions manifests/settings_fragment.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# @summary Add a fragment to settings.yaml
#
# This is a thin wrapper around concat::fragment to provide a stable API.
#
# @param content
# The content to store
# @param order
# The order of the fragment
#
# @see concat::fragment
define foreman::settings_fragment (
Variant[String[1], Deferred] $content,
String[2, 2] $order,
) {
concat::fragment { "foreman_settings+${order}-${name}":
target => '/etc/foreman/settings.yaml',
content => $content,
order => $order,
}
}
7 changes: 4 additions & 3 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "theforeman-foreman",
"version": "19.1.1",
"version": "19.2.0",
"author": "theforeman",
"summary": "Foreman server configuration",
"license": "GPL-3.0+",
Expand Down Expand Up @@ -38,7 +38,7 @@
},
{
"name": "puppet/extlib",
"version_requirement": ">= 3.0.0 < 6.0.0"
"version_requirement": ">= 3.0.0 < 7.0.0"
},
{
"name": "puppet/redis",
Expand Down Expand Up @@ -75,7 +75,8 @@
{
"operatingsystem": "Debian",
"operatingsystemrelease": [
"10"
"10",
"11"
]
},
{
Expand Down
10 changes: 10 additions & 0 deletions spec/acceptance/foreman_cli_plugins_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ class { 'foreman::cli':
gpgcheck => 0,
}
if $facts['os']['release']['major'] == '8' {
package { 'katello':
ensure => "el${facts['os']['release']['major']}",
enable_only => true,
provider => 'dnfmodule',
require => Yumrepo['katello'],
}
Package['katello'] -> Class['foreman::cli::katello']
}
class { 'foreman::cli':
foreman_url => 'https://foreman.example.com',
username => 'admin',
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/foreman_repo_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

it do
if facts[:operatingsystemmajrelease] == '8'
is_expected.to contain_package('ruby').with_ensure('2.7').with_provider('dnfmodule')
is_expected.to contain_package('foreman').with_ensure('el8').with_provider('dnfmodule')
else
is_expected.not_to contain_package('ruby')
end
Expand Down
23 changes: 23 additions & 0 deletions spec/defines/foreman_settings_fragment_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
require 'spec_helper'

describe 'foreman::settings_fragment' do
let(:title) { 'myfragment' }

context 'with string' do
let(:params) do
{
content: 'mycontent',
order: '42',
}
end

it { is_expected.to compile.with_all_deps }

it do
is_expected.to contain_concat__fragment('foreman_settings+42-myfragment')
.with_target('/etc/foreman/settings.yaml')
.with_content('mycontent')
.with_order('42')
end
end
end