-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #34824 - properly restart foreman when puma config changed
we need to restart foreman.service *before* a (possible) restart of foreman.socket, as the later *also* does restart foreman.service which leads to foreman.socket being *started* instead of *restarted* /Service[foreman.socket]: Starting to evaluate the resource (2265 of 2522) Executing: '/bin/systemctl is-active -- foreman.socket' Executing: '/bin/systemctl restart -- foreman.socket' /Service[foreman]: Starting to evaluate the resource (2266 of 2522) Executing: '/bin/systemctl is-active -- foreman' Executing: '/bin/systemctl show --property=NeedDaemonReload -- foreman' Executing: '/bin/systemctl daemon-reload' Executing: '/bin/systemctl unmask -- foreman' Executing: '/bin/systemctl start -- foreman' Executing: '/bin/systemctl is-enabled -- foreman' /Stage[main]/Foreman::Service/Service[foreman]/ensure: ensure changed 'stopped' to 'running' But in this case the now running foreman.service didn't see the changes to the service file that daemon-reload would have loaded.
- Loading branch information
Showing
3 changed files
with
50 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters