Skip to content

Commit

Permalink
Remove Certguard and File installation as plugin
Browse files Browse the repository at this point in the history
It was now merged into pulpcore
  • Loading branch information
Odilhao committed Mar 28, 2024
1 parent 738ca5a commit defdb38
Show file tree
Hide file tree
Showing 13 changed files with 72 additions and 135 deletions.
24 changes: 24 additions & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,28 @@
mode => '0640',
require => Exec['Create database symmetric key'],
}

if $pulpcore::use_pulp2_file_content_route {
$context = {
'directories' => [
{
'provider' => 'location',
'path' => '/pulp/isos',
'proxy_pass' => [
{
'url' => $pulpcore::apache::content_url,
'params' => $pulpcore::apache::content_proxy_params,
},
],
'request_headers' => [
'unset X-CLIENT-CERT',
'set X-CLIENT-CERT "%{SSL_CLIENT_CERT}s" env=SSL_CLIENT_CERT',
],
},
],
}
$content = epp('pulpcore/apache-fragment.epp', $context)
} else {
$content = undef
}
}
4 changes: 4 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@
# What percentage of available-workers will pulpcore use for import tasks at a time.
# By default, pulpcore will use all available workers.
#
# @param use_pulp2_file_content_route
# Whether to redirect the legacy (Pulp 2) URLs to the content server
#
# @example Default configuration
# include pulpcore
#
Expand Down Expand Up @@ -257,6 +260,7 @@
Optional[Boolean] $analytics = undef,
Optional[Boolean] $hide_guarded_distributions = undef,
Optional[Integer[1,100]] $import_workers_percent = undef,
Boolean $use_pulp2_file_content_route = false,
) {
$settings_file = "${config_dir}/settings.py"
$certs_dir = "${config_dir}/certs"
Expand Down
5 changes: 0 additions & 5 deletions manifests/plugin/certguard.pp

This file was deleted.

6 changes: 3 additions & 3 deletions manifests/plugin/deb.pp
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# @summary Pulp Deb plugin
# @param use_pulp2_content_route
# @param use_pulp2_file_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 $use_pulp2_file_content_route = false,
Boolean $force_ignore_missing_package_indices = true,
) {
if $use_pulp2_content_route {
if $use_pulp2_file_content_route {
$context = {
'directories' => [
{
Expand Down
35 changes: 0 additions & 35 deletions manifests/plugin/file.pp

This file was deleted.

6 changes: 3 additions & 3 deletions manifests/plugin/rpm.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# @summary Pulp RPM plugin
# @param use_pulp2_content_route
# @param use_pulp2_file_content_route
# Whether to redirect the legacy (Pulp 2) URLs to the content server
#
# @param keep_changelog_limit
Expand All @@ -11,11 +11,11 @@
# Allow resolving of conflicts due to duplicate advisory ids with different creation dates
# https://docs.pulpproject.org/pulp_rpm/settings.html#allow-automatic-unsafe-advisory-conflict-resolution
class pulpcore::plugin::rpm (
Boolean $use_pulp2_content_route = false,
Boolean $use_pulp2_file_content_route = false,
Optional[Integer[0]] $keep_changelog_limit = undef,
Boolean $allow_automatic_unsafe_advisory_conflict_resolution = false,
) {
if $use_pulp2_content_route {
if $use_pulp2_file_content_route {
$context = {
'directories' => [
{
Expand Down
2 changes: 0 additions & 2 deletions spec/acceptance/plugins_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@
<<-PUPPET
include pulpcore
include pulpcore::plugin::ansible
include pulpcore::plugin::certguard
include pulpcore::plugin::container
include pulpcore::plugin::deb
include pulpcore::plugin::file
include pulpcore::plugin::ostree
include pulpcore::plugin::python
include pulpcore::plugin::rpm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
it_behaves_like 'an idempotent resource' do
let(:manifest) do
<<-PUPPET
include pulpcore
class { 'pulpcore':
use_pulp2_file_content_route => true,
}
include pulpcore::plugin::certguard
include pulpcore::plugin::container
include pulpcore::plugin::deb
class { 'pulpcore::plugin::file':
use_pulp2_content_route => true,
}
class { 'pulpcore::plugin::rpm':
use_pulp2_content_route => true,
}
Expand Down
24 changes: 0 additions & 24 deletions spec/classes/plugin_certguard_spec.rb

This file was deleted.

2 changes: 1 addition & 1 deletion spec/classes/plugin_deb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
end

context 'with pulp2 content route' do
let(:params) { { use_pulp2_content_route: true } }
let(:params) { { use_pulp2_file_content_route: true } }

it 'contains the Apache fragment' do
is_expected.to compile.with_all_deps
Expand Down
57 changes: 0 additions & 57 deletions spec/classes/plugin_file_spec.rb

This file was deleted.

2 changes: 1 addition & 1 deletion spec/classes/plugin_rpm_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
end

context 'with pulp2 content route' do
let(:params) { { use_pulp2_content_route: true } }
let(:params) { { use_pulp2_file_content_route: true } }

it 'contains the Apache fragment' do
is_expected.to compile.with_all_deps
Expand Down
33 changes: 33 additions & 0 deletions spec/classes/pulpcore_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,39 @@
is_expected.to contain_service("pulpcore-worker@#{i}.service")
.with_ensure(true)
.with_enable(true)
end

context 'with pulp2 content route' do
let(:params) { { use_pulp2_file_content_route: true } }

it 'contains the Apache fragment' do
is_expected.to compile.with_all_deps
is_expected.to contain_pulpcore__apache__fragment('plugin-file')
is_expected.to contain_apache__vhost__fragment('pulpcore-http-plugin-file')
.with_content(
<<CONTENT
<Location "/pulp/isos">
RequestHeader unset X-CLIENT-CERT
RequestHeader set X-CLIENT-CERT "%{SSL_CLIENT_CERT}s" env=SSL_CLIENT_CERT
ProxyPass unix:///run/pulpcore-content.sock|http://pulpcore-content/pulp/content disablereuse=on timeout=600
ProxyPassReverse unix:///run/pulpcore-content.sock|http://pulpcore-content/pulp/content
</Location>
CONTENT
)
is_expected.to contain_apache__vhost__fragment('pulpcore-https-plugin-file')
.with_content(
<<CONTENT
<Location "/pulp/isos">
RequestHeader unset X-CLIENT-CERT
RequestHeader set X-CLIENT-CERT "%{SSL_CLIENT_CERT}s" env=SSL_CLIENT_CERT
ProxyPass unix:///run/pulpcore-content.sock|http://pulpcore-content/pulp/content disablereuse=on timeout=600
ProxyPassReverse unix:///run/pulpcore-content.sock|http://pulpcore-content/pulp/content
</Location>
CONTENT
)
end
end
end
end
Expand Down

0 comments on commit defdb38

Please sign in to comment.