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

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

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

**Breaking changes:**

- Fixes [\#34640](https://projects.theforeman.org/issues/34640) - Drop apipie:cache:index [\#1042](https://github.com/theforeman/puppet-foreman/pull/1042) ([ehelms](https://github.com/ehelms))

**Implemented enhancements:**

- Add Foreman Google plugin [\#1040](https://github.com/theforeman/puppet-foreman/pull/1040) ([stejskalleos](https://github.com/stejskalleos))

**Fixed bugs:**

- Fixes [\#34824](https://projects.theforeman.org/issues/34824) - properly restart foreman when puma config changed [\#1045](https://github.com/theforeman/puppet-foreman/pull/1045) ([evgeni](https://github.com/evgeni))

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

[Full Changelog](https://github.com/theforeman/puppet-foreman/compare/19.2.1...19.3.0)
Expand Down
4 changes: 2 additions & 2 deletions manifests/database.pp
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
foreman::rake { 'db:migrate':
timeout => $timeout,
unless => '/usr/sbin/foreman-rake db:abort_if_pending_migrations',
notify => Foreman::Rake['apipie:cache:index', 'apipie_dsl:cache', 'db:seed'],
notify => Foreman::Rake['apipie_dsl:cache', 'db:seed'],
}
~> foreman_config_entry { 'db_pending_seed':
value => false,
dry => true,
}
~> foreman::rake { 'db:seed':
environment => delete_undef_values($seed_env),
notify => Foreman::Rake['apipie:cache:index', 'apipie_dsl:cache'],
notify => Foreman::Rake['apipie_dsl:cache'],
}
}
}
4 changes: 0 additions & 4 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,6 @@
$db_sslmode_real = $db_sslmode
}

foreman::rake { 'apipie:cache:index':
timeout => 0,
}

foreman::rake { 'apipie_dsl:cache':
timeout => 0,
}
Expand Down
2 changes: 1 addition & 1 deletion manifests/plugin.pp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
package { $real_package:
ensure => $version,
}
~> Foreman::Rake['apipie:cache:index', 'apipie_dsl:cache']
~> Foreman::Rake['apipie_dsl:cache']

if $config {
file { $config_file:
Expand Down
5 changes: 5 additions & 0 deletions manifests/plugin/google.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Installs foreman_google plugin
class foreman::plugin::google {
foreman::plugin { 'google':
}
}
6 changes: 3 additions & 3 deletions manifests/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
}

service { $foreman_service:
ensure => $foreman_service_ensure,
enable => $foreman_service_enable,
require => Service["${foreman_service}.socket"],
ensure => $foreman_service_ensure,
enable => $foreman_service_enable,
before => Service["${foreman_service}.socket"],
}
}
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "theforeman-foreman",
"version": "19.3.0",
"version": "20.0.0",
"author": "theforeman",
"summary": "Foreman server configuration",
"license": "GPL-3.0+",
Expand Down
45 changes: 45 additions & 0 deletions spec/acceptance/foreman_service_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
require 'spec_helper_acceptance'

describe 'configures puma worker count', :order => :defined do
context 'initial configuration with 2 puma workers' do
it_behaves_like 'an idempotent resource' do
let(:manifest) do
<<-PUPPET
class { 'foreman':
foreman_service_puma_workers => 2,
}
PUPPET
end
end

describe service("foreman") do
it { is_expected.to be_enabled }
it { is_expected.to be_running }
end

describe process('puma: cluster worker') do
its(:count) { is_expected.to eq 2 }
end
end

context 'reconfigure to use 1 puma worker and restart foreman.service' do
it_behaves_like 'an idempotent resource' do
let(:manifest) do
<<-PUPPET
class { 'foreman':
foreman_service_puma_workers => 1,
}
PUPPET
end
end

describe service("foreman") do
it { is_expected.to be_enabled }
it { is_expected.to be_running }
end

describe process('puma: cluster worker') do
its(:count) { is_expected.to eq 1 }
end
end
end
1 change: 0 additions & 1 deletion spec/classes/foreman_database_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
it { should contain_foreman__rake('db:migrate') }
it { should contain_foreman_config_entry('db_pending_seed') }
it { should contain_foreman__rake('db:seed') }
it { should contain_foreman__rake('apipie:cache:index') }
it { should contain_foreman__rake('apipie_dsl:cache') }
end

Expand Down
4 changes: 2 additions & 2 deletions spec/classes/foreman_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_service('foreman.socket').with_ensure('running').with_enable(true) }
it { is_expected.to contain_service('foreman').with_ensure('running').with_enable(true) }
it { is_expected.to contain_service('foreman').with_ensure('running').with_enable(true).that_comes_before('Service[foreman.socket]') }
end

context 'with apache' do
Expand All @@ -34,7 +34,7 @@
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_class('foreman::service').that_requires('Class[apache::service]') }
it { is_expected.to contain_service('foreman.socket').with_ensure('running').with_enable(true) }
it { is_expected.to contain_service('foreman').with_ensure('running').with_enable(true) }
it { is_expected.to contain_service('foreman').with_ensure('running').with_enable(true).that_comes_before('Service[foreman.socket]') }

context 'without ssl' do
let(:params) { super().merge(ssl: false) }
Expand Down
1 change: 0 additions & 1 deletion spec/classes/foreman_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@
it { should contain_foreman__rake('db:migrate') }
it { should contain_foreman_config_entry('db_pending_seed') }
it { should contain_foreman__rake('db:seed') }
it { should contain_foreman__rake('apipie:cache:index') }
it { should contain_foreman__rake('apipie_dsl:cache') }

# jobs
Expand Down
5 changes: 5 additions & 0 deletions spec/classes/plugin/google_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require 'spec_helper'

describe 'foreman::plugin::google' do
include_examples 'basic foreman plugin tests', 'google'
end