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

## [15.1.0](https://github.com/theforeman/puppet-foreman/tree/15.1.0) (2020-08-07)

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

**Implemented enhancements:**

- Fixes [\#30078](https://projects.theforeman.org/issues/30078) - add parameter to accept a hostgroup config hash [\#863](https://github.com/theforeman/puppet-foreman/pull/863) ([apatelKmd](https://github.com/apatelKmd))
- Fixes [\#29892](https://projects.theforeman.org/issues/29892) - Use server certs for websockets [\#846](https://github.com/theforeman/puppet-foreman/pull/846) ([ekohl](https://github.com/ekohl))
- Switch to postgresql::postgresql\_password [\#845](https://github.com/theforeman/puppet-foreman/pull/845) ([mmoll](https://github.com/mmoll))

## [15.0.2](https://github.com/theforeman/puppet-foreman/tree/15.0.2) (2020-08-03)

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

**Implemented enhancements:**

- Add foreman\_statistics plugin [\#855](https://github.com/theforeman/puppet-foreman/pull/855) ([ezr-ondrej](https://github.com/ezr-ondrej))
- add plugin foreman\_column\_view [\#601](https://github.com/theforeman/puppet-foreman/pull/601) ([dgoetz](https://github.com/dgoetz))

**Fixed bugs:**

- Fixes [\#30456](https://projects.theforeman.org/issues/30456) - Fix missing icons on /pub page [\#867](https://github.com/theforeman/puppet-foreman/pull/867) ([adamruzicka](https://github.com/adamruzicka))
- fix: indent for rails\_cache\_store redis type [\#859](https://github.com/theforeman/puppet-foreman/pull/859) ([ministicraft](https://github.com/ministicraft))

## [15.0.1](https://github.com/theforeman/puppet-foreman/tree/15.0.1) (2020-06-15)

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

**Fixed bugs:**

- Fixes [\#30026](https://projects.theforeman.org/issues/30026) - Ensure Foreman is provisioned before puppetdb [\#852](https://github.com/theforeman/puppet-foreman/pull/852) ([ekohl](https://github.com/ekohl))

## [15.0.0](https://github.com/theforeman/puppet-foreman/tree/15.0.0) (2020-05-15)

[Full Changelog](https://github.com/theforeman/puppet-foreman/compare/14.0.0...15.0.0)
Expand Down
78 changes: 78 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,81 @@
## [15.1.0](https://github.com/theforeman/puppet-foreman/tree/15.1.0) (2020-08-07)

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

**Implemented enhancements:**

- Fixes [\#30078](https://projects.theforeman.org/issues/30078) - add parameter to accept a hostgroup config hash [\#863](https://github.com/theforeman/puppet-foreman/pull/863) ([apatelKmd](https://github.com/apatelKmd))
- Fixes [\#29892](https://projects.theforeman.org/issues/29892) - Use server certs for websockets [\#846](https://github.com/theforeman/puppet-foreman/pull/846) ([ekohl](https://github.com/ekohl))
- Switch to postgresql::postgresql\_password [\#845](https://github.com/theforeman/puppet-foreman/pull/845) ([mmoll](https://github.com/mmoll))

## [15.0.2](https://github.com/theforeman/puppet-foreman/tree/15.0.2) (2020-08-03)

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

**Implemented enhancements:**

- Add foreman\_statistics plugin [\#855](https://github.com/theforeman/puppet-foreman/pull/855) ([ezr-ondrej](https://github.com/ezr-ondrej))
- add plugin foreman\_column\_view [\#601](https://github.com/theforeman/puppet-foreman/pull/601) ([dgoetz](https://github.com/dgoetz))

**Fixed bugs:**

- Fixes [\#30456](https://projects.theforeman.org/issues/30456) - Fix missing icons on /pub page [\#867](https://github.com/theforeman/puppet-foreman/pull/867) ([adamruzicka](https://github.com/adamruzicka))
- fix: indent for rails\_cache\_store redis type [\#859](https://github.com/theforeman/puppet-foreman/pull/859) ([ministicraft](https://github.com/ministicraft))

## [15.0.1](https://github.com/theforeman/puppet-foreman/tree/15.0.1) (2020-06-15)

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

**Fixed bugs:**

- Fixes [\#30026](https://projects.theforeman.org/issues/30026) - Ensure Foreman is provisioned before puppetdb [\#852](https://github.com/theforeman/puppet-foreman/pull/852) ([ekohl](https://github.com/ekohl))

## [15.0.0](https://github.com/theforeman/puppet-foreman/tree/15.0.0) (2020-05-15)

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

**Breaking changes:**

- Use modern facts [\#841](https://github.com/theforeman/puppet-foreman/issues/841)
- Prefix ipa and sssd facts with foreman\_ [\#839](https://github.com/theforeman/puppet-foreman/pull/839) ([ekohl](https://github.com/ekohl))
- Remove unused parameters from puppetmaster [\#824](https://github.com/theforeman/puppet-foreman/pull/824) ([ekohl](https://github.com/ekohl))
- Rename inventory\_upload to rh\_cloud [\#821](https://github.com/theforeman/puppet-foreman/pull/821) ([ShimShtein](https://github.com/ShimShtein))
- Refactor repository handling [\#815](https://github.com/theforeman/puppet-foreman/pull/815) ([ekohl](https://github.com/ekohl))
- Use plugin\_prefix to determine plugin packages [\#809](https://github.com/theforeman/puppet-foreman/pull/809) ([ekohl](https://github.com/ekohl))
- Fixes [\#29148](https://projects.theforeman.org/issues/29148) - Use Puma instead of Passenger by default [\#802](https://github.com/theforeman/puppet-foreman/pull/802) ([sthirugn](https://github.com/sthirugn))

**Implemented enhancements:**

- Allow puppet/redis 6.x [\#840](https://github.com/theforeman/puppet-foreman/pull/840) ([ekohl](https://github.com/ekohl))
- Refs [\#29601](https://projects.theforeman.org/issues/29601): Drop foreman-release-scl in favor of centos-release-scl-rh [\#838](https://github.com/theforeman/puppet-foreman/pull/838) ([ehelms](https://github.com/ehelms))
- Switch AIO detection to use aio\_agent\_version fact [\#834](https://github.com/theforeman/puppet-foreman/pull/834) ([ekohl](https://github.com/ekohl))
- Add Leapp plugin [\#833](https://github.com/theforeman/puppet-foreman/pull/833) ([stejskalleos](https://github.com/stejskalleos))
- Fixes [\#29212](https://projects.theforeman.org/issues/29212) - support el8 [\#828](https://github.com/theforeman/puppet-foreman/pull/828) ([wbclark](https://github.com/wbclark))
- Only install foreman-release-scl on CentOS EL 7 [\#822](https://github.com/theforeman/puppet-foreman/pull/822) ([ehelms](https://github.com/ehelms))
- Allow extlib 5.x [\#820](https://github.com/theforeman/puppet-foreman/pull/820) ([mmoll](https://github.com/mmoll))
- Refs [\#29144](https://projects.theforeman.org/issues/29144) - Use systemd socket activation [\#814](https://github.com/theforeman/puppet-foreman/pull/814) ([ekohl](https://github.com/ekohl))
- Fixes [\#29255](https://projects.theforeman.org/issues/29255) - Set plugin config file mode to 0640 [\#807](https://github.com/theforeman/puppet-foreman/pull/807) ([ekohl](https://github.com/ekohl))
- Fixes [\#28955](https://projects.theforeman.org/issues/28955) - Add puma configuration tuning options [\#790](https://github.com/theforeman/puppet-foreman/pull/790) ([sthirugn](https://github.com/sthirugn))
- Fixes [\#28436](https://projects.theforeman.org/issues/28436) - Add keycloak support [\#779](https://github.com/theforeman/puppet-foreman/pull/779) ([ekohl](https://github.com/ekohl))
- Add options for rails\_cache\_store [\#762](https://github.com/theforeman/puppet-foreman/pull/762) ([dgoetz](https://github.com/dgoetz))

**Fixed bugs:**

- Ensure Foreman is provisioned before configuring cockpit [\#835](https://github.com/theforeman/puppet-foreman/pull/835) ([ekohl](https://github.com/ekohl))
- Drop the separate rails repository [\#826](https://github.com/theforeman/puppet-foreman/pull/826) ([ekohl](https://github.com/ekohl))
- Refs [\#29148](https://projects.theforeman.org/issues/29148): Do not proxy /pulp2 to Puma [\#811](https://github.com/theforeman/puppet-foreman/pull/811) ([ehelms](https://github.com/ehelms))
- Correct casing on Stdlib::HTTPUrl [\#806](https://github.com/theforeman/puppet-foreman/pull/806) ([ekohl](https://github.com/ekohl))
- Fixes [\#28739](https://projects.theforeman.org/issues/28739): Fix static asset caching when using Puma [\#788](https://github.com/theforeman/puppet-foreman/pull/788) ([ehelms](https://github.com/ehelms))

**Closed issues:**

- db\_username changes do not work [\#750](https://github.com/theforeman/puppet-foreman/issues/750)

**Merged pull requests:**

- Make camptocamp/systemd a hard dependency [\#825](https://github.com/theforeman/puppet-foreman/pull/825) ([ekohl](https://github.com/ekohl))
- Make foreman::config::apache standalone [\#800](https://github.com/theforeman/puppet-foreman/pull/800) ([ekohl](https://github.com/ekohl))

## [14.0.0](https://github.com/theforeman/puppet-foreman/tree/14.0.0) (2020-02-12)

[Full Changelog](https://github.com/theforeman/puppet-foreman/compare/13.1.0...14.0.0)
Expand Down
4 changes: 4 additions & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
}
}

# Used in the settings template
$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',
content => template('foreman/settings.yaml.erb'),
Expand Down
2 changes: 1 addition & 1 deletion manifests/config/apache.pp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
Stdlib::Port $server_ssl_port = 443,
Stdlib::HTTPUrl $proxy_backend = 'http://localhost:3000/',
Hash $proxy_params = {'retry' => '0'},
Array[String] $proxy_no_proxy_uris = ['/pulp', '/pulp2', '/streamer', '/pub'],
Array[String] $proxy_no_proxy_uris = ['/pulp', '/pulp2', '/streamer', '/pub', '/icons'],
Boolean $ssl = false,
Optional[Stdlib::Absolutepath] $ssl_ca = undef,
Optional[Stdlib::Absolutepath] $ssl_chain = undef,
Expand Down
2 changes: 1 addition & 1 deletion manifests/database/postgresql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

$password = $foreman::db_password ? {
'UNSET' => false,
default => postgresql_password($foreman::db_username, $foreman::db_password),
default => postgresql::postgresql_password($foreman::db_username, $foreman::db_password),
}

# Prevents errors if run from /root etc.
Expand Down
4 changes: 2 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,8 @@
String $pam_service = $foreman::params::pam_service,
Boolean $ipa_manage_sssd = $foreman::params::ipa_manage_sssd,
Boolean $websockets_encrypt = $foreman::params::websockets_encrypt,
Stdlib::Absolutepath $websockets_ssl_key = $foreman::params::websockets_ssl_key,
Stdlib::Absolutepath $websockets_ssl_cert = $foreman::params::websockets_ssl_cert,
Optional[Stdlib::Absolutepath] $websockets_ssl_key = $foreman::params::websockets_ssl_key,
Optional[Stdlib::Absolutepath] $websockets_ssl_cert = $foreman::params::websockets_ssl_cert,
Enum['debug', 'info', 'warn', 'error', 'fatal'] $logging_level = $foreman::params::logging_level,
Enum['file', 'syslog', 'journald'] $logging_type = $foreman::params::logging_type,
Enum['pattern', 'multiline_pattern', 'json'] $logging_layout = $foreman::params::logging_layout,
Expand Down
4 changes: 2 additions & 2 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@

# Websockets
$websockets_encrypt = true
$websockets_ssl_key = $server_ssl_key
$websockets_ssl_cert = $server_ssl_cert
$websockets_ssl_key = undef
$websockets_ssl_cert = undef

# Application logging
$logging_level = 'info'
Expand Down
15 changes: 15 additions & 0 deletions manifests/plugin/column_view.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# @summary Install the column view plugin and optionally manage the configuration file
#
# @param columns
# an hash of columns to add to the configuration
#
class foreman::plugin::column_view (
Hash[String, Hash] $columns = {},
){
# https://projects.theforeman.org/issues/21398
assert_type(Hash[String, Foreman::Column_view_column], $columns)

foreman::plugin { 'column_view':
config => template('foreman/foreman_column_view.yaml.erb'),
}
}
20 changes: 17 additions & 3 deletions manifests/plugin/default_hostgroup.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
# Installs foreman_default_hostgroup plugin
class foreman::plugin::default_hostgroup {
foreman::plugin {'default_hostgroup': }
# @summary This class installs the default_hostgroup plugin and optionally manages the configuration file
#
# @param hostgroups An array of hashes of hostgroup names and facts to add to the configuration
#
class foreman::plugin::default_hostgroup (
Array[Hash[String, Hash]] $hostgroups = [],
){
if empty($hostgroups) {
$config = undef
} else {
$config = template('foreman/default_hostgroup.yaml.erb')
}

foreman::plugin {'default_hostgroup':
config => $config,
config_file => "${foreman::plugin_config_dir}/default_hostgroup.yaml",
}
}
30 changes: 14 additions & 16 deletions manifests/plugin/puppetdb.pp
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,20 @@
foreman::plugin { 'puppetdb':
package => $foreman::plugin_prefix.regsubst(/foreman[_-]/, 'puppetdb_foreman'),
}
-> foreman_config_entry { 'puppetdb_enabled':
value => true,

$config = {
'puppetdb_enabled' => true,
'puppetdb_address' => $address,
'puppetdb_ssl_ca_file' => $ssl_ca_file,
'puppetdb_ssl_certificate' => $ssl_certificate,
'puppetdb_ssl_private_key' => $ssl_private_key,
'puppetdb_api_version' => $api_version,
}
-> foreman_config_entry { 'puppetdb_address':
value => $address,
}
-> foreman_config_entry { 'puppetdb_ssl_ca_file':
value => $ssl_ca_file,
}
-> foreman_config_entry { 'puppetdb_ssl_certificate':
value => $ssl_certificate,
}
-> foreman_config_entry { 'puppetdb_ssl_private_key':
value => $ssl_private_key,
}
-> foreman_config_entry { 'puppetdb_api_version':
value => $api_version,

$config.each |$setting, $value| {
foreman_config_entry { $setting:
value => $value,
require => Class['foreman::database'],
}
}
}
8 changes: 8 additions & 0 deletions manifests/plugin/statistics.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# = Foreman Statistics plugin
#
# This class installs trends and statistics plugin
#
class foreman::plugin::statistics {
foreman::plugin {'statistics':
}
}
4 changes: 2 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "theforeman-foreman",
"version": "15.0.0",
"version": "15.1.0",
"author": "theforeman",
"summary": "Foreman server configuration",
"license": "GPL-3.0+",
Expand Down Expand Up @@ -30,7 +30,7 @@
},
{
"name": "puppetlabs/postgresql",
"version_requirement": ">= 4.2.0 < 7.0.0"
"version_requirement": ">= 6.5.0 < 7.0.0"
},
{
"name": "puppetlabs/stdlib",
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/foreman_config_apache_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
'set SSL_CLIENT_VERIFY ""'
])
.with_proxy_pass(
"no_proxy_uris" => ['/pulp', '/pulp2', '/streamer', '/pub'],
"no_proxy_uris" => ['/pulp', '/pulp2', '/streamer', '/pub', '/icons'],
"path" => '/',
"url" => 'http://localhost:3000/',
"params" => { "retry" => '0' },
Expand All @@ -249,7 +249,7 @@
])
.with_ssl_proxyengine(true)
.with_proxy_pass(
"no_proxy_uris" => ['/pulp', '/pulp2', '/streamer', '/pub'],
"no_proxy_uris" => ['/pulp', '/pulp2', '/streamer', '/pub', '/icons'],
"path" => '/',
"url" => 'http://localhost:3000/',
"params" => { "retry" => '0' },
Expand Down
12 changes: 10 additions & 2 deletions spec/classes/foreman_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
.with_content(/^:oauth_consumer_key:\s*\w+$/)
.with_content(/^:oauth_consumer_secret:\s*\w+$/)
.with_content(/^:websockets_encrypt:\s*true$/)
.with_content(%r{^:websockets_ssl_key:\s*/etc/puppetlabs/puppet/ssl/private_keys/foo\.example\.com\.pem$})
.with_content(%r{^:websockets_ssl_cert:\s*/etc/puppetlabs/puppet/ssl/certs/foo\.example\.com\.pem$})
.with_content(%r{^:ssl_certificate:\s*/etc/puppetlabs/puppet/ssl/certs/foo\.example\.com\.pem$})
.with_content(%r{^:ssl_ca_file:\s*/etc/puppetlabs/puppet/ssl/certs/ca.pem$})
.with_content(%r{^:ssl_priv_key:\s*/etc/puppetlabs/puppet/ssl/private_keys/foo\.example\.com\.pem$})
Expand Down Expand Up @@ -236,8 +238,8 @@
pam_service: 'foreman',
ipa_manage_sssd: true,
websockets_encrypt: true,
websockets_ssl_key: '/etc/ssl/private/snakeoil.pem',
websockets_ssl_cert: '/etc/ssl/certs/snakeoil.pem',
websockets_ssl_key: '/etc/ssl/private/snakeoil-ws.pem',
websockets_ssl_cert: '/etc/ssl/certs/snakeoil-ws.pem',
logging_level: 'info',
loggers: {},
email_delivery_method: 'sendmail',
Expand All @@ -260,6 +262,12 @@
.with_keycloak_app_name('cloak-app')
.with_keycloak_realm('myrealm')
end

it 'should configure certificates in settings.yaml' do
is_expected.to contain_concat__fragment('foreman_settings+01-header.yaml')
.with_content(%r{^:websockets_ssl_key: /etc/ssl/private/snakeoil-ws\.pem$})
.with_content(%r{^:websockets_ssl_cert: /etc/ssl/certs/snakeoil-ws\.pem$})
end
end

context 'with journald logging' do
Expand Down
63 changes: 63 additions & 0 deletions spec/classes/plugin/column_view_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
require 'spec_helper'

describe 'foreman::plugin::column_view' do
include_examples 'basic foreman plugin tests', 'column_view'

context 'with columns hash architecture' do
let(:params) do
{
'columns' => {
'architecture' => {
'title' => 'Architecture',
'after' => 'last_report',
'content' => 'facts_hash["architecture"]',
}
}
}
end

it { is_expected.to contain_file('/etc/foreman/plugins/foreman_column_view.yaml').with_content(/.*:title: Architecture.*/) }

it { is_expected.to compile.with_all_deps }
end

context 'with columns hash architecture and console' do
let(:params) do
{
'columns' => {
'architecture' => {
'title' => 'Architecture',
'after' => 'last_report',
'content' => 'facts_hash["architecture"]',
},
'console' => {
'title' => 'Console',
'after' => '0',
'content' => 'link_to(_("Console"), "https://#{host.interfaces.first.name}.domainname", { :class => "btn btn-info" } )',
'conditional' => ':bmc_available?',
'eval_content' => 'true',
'view' => ':hosts_properties',
}
}
}
end

it { is_expected.to contain_file('/etc/foreman/plugins/foreman_column_view.yaml').with_content(/.*:title: Console.*/) }

it { is_expected.to compile.with_all_deps }
end

context 'with columns hash broken' do
let(:params) do
{
'columns' => {
'broken' => {
'title' => 'Broken',
}
}
}
end

it { is_expected.to compile.and_raise_error(%r{broken}) }
end
end
Loading