Skip to content

Commit

Permalink
Fixes #35496 - Add default pulp_deb config
Browse files Browse the repository at this point in the history
https://projects.theforeman.org/issues/35496

For Katello users this is the sane/expected default behaviour. It allows
for the synchronization of partial Ubuntu mirrors, a very common use
case in the wild. Users often stumble over the error that is thrown for
such mirrors without this setting.
  • Loading branch information
quba42 committed Oct 28, 2022
1 parent 54ee9bf commit 00b0f47
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
10 changes: 9 additions & 1 deletion manifests/plugin/deb.pp
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# @summary Pulp Deb plugin
# @param use_pulp2_content_route Whether to redirect the legacy (Pulp 2) URL, /pulp/deb/, to the content server
# @param use_pulp2_content_route
# Whether to redirect the legacy (Pulp 2) URL, /pulp/deb/, to the content server
# @param force_ignore_missing_package_indices
# Wheter to set the FORCE_IGNORE_MISSING_PACKAGE_INDICES setting to True or
# False in /etc/pulp/settings.py.
class pulpcore::plugin::deb (
Boolean $use_pulp2_content_route = false,
Boolean $force_ignore_missing_package_indices = true,
) {
if $use_pulp2_content_route {
$context = {
Expand All @@ -27,7 +32,10 @@
$content = undef
}

$deb_plugin_config_fimpi = to_python($force_ignore_missing_package_indices)

pulpcore::plugin { 'deb':
config => "FORCE_IGNORE_MISSING_PACKAGE_INDICES = ${deb_plugin_config_fimpi}",
http_content => $content,
https_content => $content,
}
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
{
"name": "puppetlabs/stdlib",
"version_requirement": ">= 4.25.0 < 9.0.0"
"version_requirement": ">= 8.3.0 < 9.0.0"
},
{
"name": "puppet/redis",
Expand Down
10 changes: 10 additions & 0 deletions spec/classes/plugin_deb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@
is_expected.to contain_pulpcore__plugin('deb')
.that_subscribes_to('Class[Pulpcore::Install]')
.that_notifies(['Class[Pulpcore::Database]', 'Class[Pulpcore::Service]'])
.with_config('FORCE_IGNORE_MISSING_PACKAGE_INDICES = True')
end

context 'with force ignore missing set' do
let(:params) { { force_ignore_missing_package_indices: false } }

it do
is_expected.to contain_pulpcore__plugin('deb')
.with_config('FORCE_IGNORE_MISSING_PACKAGE_INDICES = False')
end
end

context 'with pulp2 content route' do
Expand Down

0 comments on commit 00b0f47

Please sign in to comment.