diff --git a/config/foreman-proxy-content-answers.yaml b/config/foreman-proxy-content-answers.yaml index 6c28cc5a..3e8d87e4 100644 --- a/config/foreman-proxy-content-answers.yaml +++ b/config/foreman-proxy-content-answers.yaml @@ -14,6 +14,8 @@ certs: foreman_proxy_content: pulpcore_mirror: true puppet: false + pulpcore_api_control_socket_path: /run/pulpcore-api/gunicorn.ctl + pulpcore_content_control_socket_path: /run/pulpcore-content/gunicorn.ctl foreman_proxy: foreman_ssl_ca: /etc/foreman-proxy/foreman_ssl_ca.pem foreman_ssl_cert: /etc/foreman-proxy/foreman_ssl_cert.pem diff --git a/config/foreman-proxy-content.migrations/20260430083000-set-gunicorn-control-socket.rb b/config/foreman-proxy-content.migrations/20260430083000-set-gunicorn-control-socket.rb new file mode 100644 index 00000000..4c0987fd --- /dev/null +++ b/config/foreman-proxy-content.migrations/20260430083000-set-gunicorn-control-socket.rb @@ -0,0 +1,4 @@ +if answers['foreman_proxy_content'].is_a?(Hash) + answers['foreman_proxy_content']['pulpcore_api_control_socket_path'] ||= '/run/pulpcore-api/gunicorn.ctl' + answers['foreman_proxy_content']['pulpcore_content_control_socket_path'] ||= '/run/pulpcore-content/gunicorn.ctl' +end diff --git a/config/katello.migrations/20260430083000-set-gunicorn-control-socket.rb b/config/katello.migrations/20260430083000-set-gunicorn-control-socket.rb new file mode 100644 index 00000000..4c0987fd --- /dev/null +++ b/config/katello.migrations/20260430083000-set-gunicorn-control-socket.rb @@ -0,0 +1,4 @@ +if answers['foreman_proxy_content'].is_a?(Hash) + answers['foreman_proxy_content']['pulpcore_api_control_socket_path'] ||= '/run/pulpcore-api/gunicorn.ctl' + answers['foreman_proxy_content']['pulpcore_content_control_socket_path'] ||= '/run/pulpcore-content/gunicorn.ctl' +end diff --git a/spec/fixtures/pulpcore-migration-dont-use-content-plugins-on-upgrades/katello-answers-after.yaml b/spec/fixtures/pulpcore-migration-dont-use-content-plugins-on-upgrades/katello-answers-after.yaml index 13d906f0..f396060a 100644 --- a/spec/fixtures/pulpcore-migration-dont-use-content-plugins-on-upgrades/katello-answers-after.yaml +++ b/spec/fixtures/pulpcore-migration-dont-use-content-plugins-on-upgrades/katello-answers-after.yaml @@ -62,6 +62,8 @@ foreman_proxy_content: proxy_pulp_isos_to_pulpcore: false proxy_pulp_yum_to_pulpcore: false puppet: false + pulpcore_api_control_socket_path: /run/pulpcore-api/gunicorn.ctl + pulpcore_content_control_socket_path: /run/pulpcore-content/gunicorn.ctl katello: enable_deb: true use_pulp_2_for_deb: true diff --git a/spec/fixtures/pulpcore-migration-rpm-only/katello-answers-after.yaml b/spec/fixtures/pulpcore-migration-rpm-only/katello-answers-after.yaml index 9daace08..2f753663 100644 --- a/spec/fixtures/pulpcore-migration-rpm-only/katello-answers-after.yaml +++ b/spec/fixtures/pulpcore-migration-rpm-only/katello-answers-after.yaml @@ -62,6 +62,8 @@ foreman_proxy_content: proxy_pulp_yum_to_pulpcore: false proxy_pulp_deb_to_pulpcore: false puppet: false + pulpcore_api_control_socket_path: /run/pulpcore-api/gunicorn.ctl + pulpcore_content_control_socket_path: /run/pulpcore-content/gunicorn.ctl katello: use_pulp_2_for_deb: true use_pulp_2_for_docker: true diff --git a/spec/fixtures/pulpcore-migration/katello-answers-after.yaml b/spec/fixtures/pulpcore-migration/katello-answers-after.yaml index 4e14b485..322e564b 100644 --- a/spec/fixtures/pulpcore-migration/katello-answers-after.yaml +++ b/spec/fixtures/pulpcore-migration/katello-answers-after.yaml @@ -61,6 +61,8 @@ foreman_proxy_content: proxy_pulp_isos_to_pulpcore: false proxy_pulp_yum_to_pulpcore: false proxy_pulp_deb_to_pulpcore: false + pulpcore_api_control_socket_path: /run/pulpcore-api/gunicorn.ctl + pulpcore_content_control_socket_path: /run/pulpcore-content/gunicorn.ctl katello: use_pulp_2_for_docker: true use_pulp_2_for_file: true diff --git a/spec/migrations/20260430083000-set-gunicorn-control-socket_spec.rb b/spec/migrations/20260430083000-set-gunicorn-control-socket_spec.rb new file mode 100644 index 00000000..4589eab5 --- /dev/null +++ b/spec/migrations/20260430083000-set-gunicorn-control-socket_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +migration '20260430083000-set-gunicorn-control-socket' do + scenarios %w[katello foreman-proxy-content] do + context 'without existing socket path answers' do + let(:answers) { { 'foreman_proxy_content' => {} } } + + it 'sets the api control socket path' do + expect(migrated_answers['foreman_proxy_content']['pulpcore_api_control_socket_path']) + .to eq('/run/pulpcore-api/gunicorn.ctl') + end + + it 'sets the content control socket path' do + expect(migrated_answers['foreman_proxy_content']['pulpcore_content_control_socket_path']) + .to eq('/run/pulpcore-content/gunicorn.ctl') + end + end + + context 'with existing custom socket paths' do + let(:answers) do + { + 'foreman_proxy_content' => { + 'pulpcore_api_control_socket_path' => '/custom/api.ctl', + 'pulpcore_content_control_socket_path' => '/custom/content.ctl', + }, + } + end + + it 'preserves a custom api socket path' do + expect(migrated_answers['foreman_proxy_content']['pulpcore_api_control_socket_path']) + .to eq('/custom/api.ctl') + end + + it 'preserves a custom content socket path' do + expect(migrated_answers['foreman_proxy_content']['pulpcore_content_control_socket_path']) + .to eq('/custom/content.ctl') + end + end + end +end