Skip to content

Commit

Permalink
Disable and remove pulpcore-resource-manager.service when not using R…
Browse files Browse the repository at this point in the history
…Q tasking
  • Loading branch information
wbclark committed Jul 6, 2021
1 parent 7789489 commit 445fb38
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 17 deletions.
14 changes: 10 additions & 4 deletions manifests/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,16 @@
service_content => template('pulpcore/pulpcore-content.service.erb'),
}

systemd::unit_file { 'pulpcore-resource-manager.service':
content => template('pulpcore/pulpcore-resource-manager.service.erb'),
active => $pulpcore::service_ensure,
enable => $pulpcore::service_enable,
if $pulpcore::use_rq_tasking_system {
systemd::unit_file { 'pulpcore-resource-manager.service':
content => template('pulpcore/pulpcore-resource-manager.service.erb'),
active => $pulpcore::service_ensure,
enable => $pulpcore::service_enable,
}
} else {
systemd::unit_file { 'pulpcore-resource-manager.service':
ensure => 'absent',
}
}

systemd::unit_file { '[email protected]':
Expand Down
8 changes: 4 additions & 4 deletions spec/acceptance/basic_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class { 'pulpcore':
end

describe service('pulpcore-resource-manager') do
it { is_expected.to be_enabled }
it { is_expected.to be_running }
it { is_expected.not_to be_enabled }
it { is_expected.not_to be_running }
end

describe service('pulpcore-worker@1') do
Expand Down Expand Up @@ -113,8 +113,8 @@ class { 'pulpcore':
end

describe service('pulpcore-resource-manager') do
it { is_expected.to be_enabled }
it { is_expected.to be_running }
it { is_expected.not_to be_enabled }
it { is_expected.not_to be_running }
end

describe service('pulpcore-worker@1') do
Expand Down
12 changes: 10 additions & 2 deletions spec/acceptance/disable_new_tasking_system_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,13 @@ class { 'pulpcore':
it { is_expected.to be_running }
end

describe file('/etc/systemd/system/pulpcore-resource-manager.service') do
it { is_expected.not_to exist }
end

describe service('pulpcore-resource-manager') do
it { is_expected.to be_enabled }
it { is_expected.to be_running }
it { is_expected.not_to be_enabled }
it { is_expected.not_to be_running }
end

describe service('pulpcore-worker@1') do
Expand Down Expand Up @@ -93,6 +97,10 @@ class { 'pulpcore':
it { is_expected.to be_running }
end

describe file('/etc/systemd/system/pulpcore-resource-manager.service') do
it { is_expected.to exist }
end

describe service('pulpcore-resource-manager') do
it { is_expected.to be_enabled }
it { is_expected.to be_running }
Expand Down
12 changes: 10 additions & 2 deletions spec/acceptance/enable_new_tasking_system_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ class { 'pulpcore':
it { is_expected.to be_running }
end

describe file('/etc/systemd/system/pulpcore-resource-manager.service') do
it { is_expected.to exist }
end

describe service('pulpcore-resource-manager') do
it { is_expected.to be_enabled }
it { is_expected.to be_running }
Expand Down Expand Up @@ -93,9 +97,13 @@ class { 'pulpcore':
it { is_expected.to be_running }
end

describe file('/etc/systemd/system/pulpcore-resource-manager.service') do
it { is_expected.not_to exist }
end

describe service('pulpcore-resource-manager') do
it { is_expected.to be_enabled }
it { is_expected.to be_running }
it { is_expected.not_to be_enabled }
it { is_expected.not_to be_running }
end

describe service('pulpcore-worker@1') do
Expand Down
4 changes: 2 additions & 2 deletions spec/acceptance/plugins_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
end

describe service('pulpcore-resource-manager') do
it { is_expected.to be_enabled }
it { is_expected.to be_running }
it { is_expected.not_to be_enabled }
it { is_expected.not_to be_running }
end

describe port(80) do
Expand Down
4 changes: 2 additions & 2 deletions spec/acceptance/use_pulp2_content_route_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class { 'pulpcore::plugin::rpm':
end

describe service('pulpcore-resource-manager') do
it { is_expected.to be_enabled }
it { is_expected.to be_running }
it { is_expected.not_to be_enabled }
it { is_expected.not_to be_running }
end

describe port(80) do
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/pulpcore_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
is_expected.to contain_systemd__unit_file('pulpcore-content.socket')
is_expected.to contain_systemd__unit_file('pulpcore-content.service')
is_expected.to contain_file('/etc/systemd/system/pulpcore-content.socket').that_comes_before('Service[pulpcore-content.service]')
is_expected.to contain_systemd__unit_file('pulpcore-resource-manager.service')
is_expected.to contain_systemd__unit_file('pulpcore-resource-manager.service').with_ensure('absent')
is_expected.to contain_systemd__unit_file('[email protected]')
is_expected.to contain_service("[email protected]").with_ensure(true)
is_expected.not_to contain_service("[email protected]")
Expand Down
8 changes: 8 additions & 0 deletions templates/settings.py.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
########################################################################################
# WARNING: This file is externally managed and you should never make manual edits. #
# #
# Not only are your edits likely to be overwritten, there is also a strong possibility #
# of breaking your system. Refer to documentation for the software that installed #
# Pulpcore to determine the safe and persistent way to modify the configuration. #
########################################################################################

CONTENT_HOST = "<%= scope['pulpcore::servername'] %>"
CONTENT_ORIGIN = "https://<%= scope['pulpcore::servername'] %>"
SECRET_KEY = "<%= scope['pulpcore::django_secret_key'] %>"
Expand Down

0 comments on commit 445fb38

Please sign in to comment.