Skip to content

Commit 6f64423

Browse files
evgeniekohl
authored andcommitted
Fixes #33864 - disable registration module by default
1 parent 3f2685f commit 6f64423

File tree

3 files changed

+43
-2
lines changed

3 files changed

+43
-2
lines changed

manifests/init.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@
329329
Boolean $templates = false,
330330
Foreman_proxy::ListenOn $templates_listen_on = 'both',
331331
Stdlib::HTTPUrl $template_url = $foreman_proxy::params::template_url,
332-
Boolean $registration = true,
332+
Boolean $registration = false,
333333
Foreman_proxy::ListenOn $registration_listen_on = 'https',
334334
Boolean $logs = true,
335335
Foreman_proxy::ListenOn $logs_listen_on = 'https',

spec/classes/foreman_proxy__register__spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
before { subject.resource('Datacat_collector[foreman_proxy::enabled_features]').provider.exists? }
4545

4646
it 'should populate features on foreman_smartproxy' do
47-
expect(subject.resource("Foreman_smartproxy[#{facts[:fqdn]}]").parameters[:features].should.sort).to match_array(["Logs", "Puppet", "Puppet CA", "Registration"])
47+
expect(subject.resource("Foreman_smartproxy[#{facts[:fqdn]}]").parameters[:features].should.sort).to match_array(["Logs", "Puppet", "Puppet CA"])
4848
end
4949
end
5050
end

spec/classes/foreman_proxy__spec.rb

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,13 @@
307307
])
308308
end
309309

310+
it 'should generate correct registration.yml' do
311+
verify_exact_contents(catalogue, "#{etc_dir}/foreman-proxy/settings.d/registration.yml", [
312+
'---',
313+
':enabled: false',
314+
])
315+
end
316+
310317
it 'should generate correct logs.yml' do
311318
verify_exact_contents(catalogue, "#{etc_dir}/foreman-proxy/settings.d/logs.yml", [
312319
'---',
@@ -808,6 +815,40 @@
808815
end
809816
end
810817

818+
context 'with registration => true' do
819+
let(:params) { super().merge(registration: true) }
820+
821+
context 'with feature on http' do
822+
let(:params) { super().merge(registration_listen_on: 'http') }
823+
824+
it 'should set enabled to http' do
825+
verify_contents(catalogue, "#{etc_dir}/foreman-proxy/settings.d/registration.yml", [
826+
':enabled: http',
827+
])
828+
end
829+
end
830+
831+
context 'with feature on https' do
832+
let(:params) { super().merge(registration_listen_on: 'https') }
833+
834+
it 'should set enabled to https' do
835+
verify_contents(catalogue, "#{etc_dir}/foreman-proxy/settings.d/registration.yml", [
836+
':enabled: https',
837+
])
838+
end
839+
end
840+
841+
context 'with feature on both' do
842+
let(:params) { super().merge(registration_listen_on: 'both') }
843+
844+
it 'should set enabled to true' do
845+
verify_contents(catalogue, "#{etc_dir}/foreman-proxy/settings.d/registration.yml", [
846+
':enabled: true',
847+
])
848+
end
849+
end
850+
end
851+
811852
context 'when log_level => DEBUG' do
812853
let(:params) { super().merge(log_level: 'DEBUG') }
813854

0 commit comments

Comments
 (0)