Skip to content

Commit

Permalink
Remove $dynflow_in_core
Browse files Browse the repository at this point in the history
  • Loading branch information
ekohl committed Aug 15, 2018
1 parent f6ccc58 commit 14db69b
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 119 deletions.
5 changes: 1 addition & 4 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,6 @@
#
# $jobs_service:: Name of the service for running the background Dynflow executor
#
# $dynflow_in_core:: Whether the Dynflow executor service is provided by Foreman or tasks
#
# $hsts_enabled:: Should HSTS enforcement in https requests be enabled
#
class foreman (
Expand Down Expand Up @@ -322,8 +320,7 @@
Boolean $telemetry_logger_enabled = $::foreman::params::telemetry_logger_enabled,
Enum['DEBUG', 'INFO', 'WARN', 'ERROR', 'FATAL'] $telemetry_logger_level = $::foreman::params::telemetry_logger_level,
Integer[0, 65535] $dynflow_pool_size = $::foreman::params::dynflow_pool_size,
Optional[String] $jobs_service = $::foreman::params::jobs_service,
Boolean $dynflow_in_core = $::foreman::params::dynflow_in_core,
String $jobs_service = $::foreman::params::jobs_service,
Boolean $hsts_enabled = $::foreman::params::hsts_enabled,
) inherits foreman::params {
if $db_adapter == 'UNSET' {
Expand Down
4 changes: 1 addition & 3 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,9 @@

# Configure how many workers should Dynflow use
$dynflow_pool_size = 5
# Defines whether Foreman or the tasks plugin provides the Dynflow executor
$dynflow_in_core = true

# Define job processing service properties
$jobs_service = undef
$jobs_service = 'dynflowd'
$jobs_service_ensure = 'running'
$jobs_service_enable = true

Expand Down
15 changes: 9 additions & 6 deletions manifests/service.pp
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# Configure the foreman service
class foreman::service(
$passenger = $::foreman::passenger,
$app_root = $::foreman::app_root,
$ssl = $::foreman::ssl,
$dynflow_in_core = $::foreman::dynflow_in_core,
Boolean $passenger = $::foreman::passenger,
Stdlib::Absolutepath $app_root = $::foreman::app_root,
Boolean $ssl = $::foreman::ssl,
String $jobs_service = $::foreman::jobs_service,
Enum['running', 'stopped'] $jobs_service_ensure = $::foreman::jobs_service_ensure,
Boolean $jobs_service_enable = $::foreman::jobs_service_enable,
) {
anchor { ['foreman::service_begin', 'foreman::service_end']: }

if $dynflow_in_core {
contain ::foreman::service::jobs
service { $jobs_service:
ensure => $jobs_service_ensure,
enable => $jobs_service_enable,
}

if $passenger {
Expand Down
39 changes: 0 additions & 39 deletions manifests/service/jobs.pp

This file was deleted.

51 changes: 0 additions & 51 deletions spec/classes/foreman_service_jobs.rb

This file was deleted.

36 changes: 20 additions & 16 deletions spec/classes/foreman_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
end

it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_class('foreman::service::jobs') }
it { is_expected.to contain_service('dynflowd').with_ensure('running').with_enable(true) }

it 'should restart passenger' do
should contain_exec('restart_foreman').with({
Expand All @@ -37,10 +37,12 @@

let :params do
{
:passenger => true,
:app_root => '/usr/share/foreman',
:ssl => true,
:dynflow_in_core => false,
:passenger => true,
:app_root => '/usr/share/foreman',
:ssl => true,
:jobs_service => 'dynflower',
:jobs_service_ensure => 'stopped',
:jobs_service_enable => false,
}
end

Expand All @@ -49,7 +51,7 @@
end

it { is_expected.to compile.with_all_deps }
it { is_expected.not_to contain_class('foreman::service::jobs') }
it { is_expected.to contain_service('dynflower').with_ensure('stopped').with_enable(false) }

it 'should restart passenger' do
should contain_exec('restart_foreman').with({
Expand All @@ -72,30 +74,32 @@
context 'without ssl' do
let :params do
{
:passenger => true,
:app_root => '/usr/share/foreman',
:ssl => false,
:dynflow_in_core => false,
:passenger => true,
:app_root => '/usr/share/foreman',
:ssl => false,
:jobs_service => 'dynflowd',
:jobs_service_ensure => 'running',
:jobs_service_enable => true,
}
end

it { is_expected.to compile.with_all_deps }
it { is_expected.not_to contain_class('foreman::service::jobs') }
end
end

context 'without passenger' do
let :params do
{
:passenger => false,
:app_root => '/usr/share/foreman',
:ssl => true,
:dynflow_in_core => false,
:passenger => false,
:app_root => '/usr/share/foreman',
:ssl => true,
:jobs_service => 'dynflowd',
:jobs_service_ensure => 'running',
:jobs_service_enable => true,
}
end

it { is_expected.to compile.with_all_deps }
it { is_expected.not_to contain_class('foreman::service::jobs') }

it 'should not restart passenger' do
should_not contain_exec('restart_foreman')
Expand Down

0 comments on commit 14db69b

Please sign in to comment.