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 6838c6e
Show file tree
Hide file tree
Showing 13 changed files with 73 additions and 136 deletions.
24 changes: 24 additions & 0 deletions manifests/config.pp
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
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
@@ -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.

4 changes: 2 additions & 2 deletions manifests/repo.pp
Expand Up @@ -16,10 +16,10 @@

yumrepo { 'pulpcore':
descr => "Pulpcore ${version}",
baseurl => pick($baseurl, "https://yum.theforeman.org/pulpcore/${version}/${dist_tag}/\$basearch"),
baseurl => pick($baseurl, "https://stagingyum.theforeman.org/pulpcore/${version}/${dist_tag}/\$basearch"),
enabled => '1',
gpgcheck => if $gpgkey == '' or $version == 'nightly' { '0' } else { '1' },
gpgkey => pick($gpgkey, "https://yum.theforeman.org/pulpcore/${version}/GPG-RPM-KEY-pulpcore"),
gpgkey => pick($gpgkey, "https://stagingyum.theforeman.org/pulpcore/${version}/GPG-RPM-KEY-pulpcore"),
notify => Anchor['pulpcore::repo'],
}

Expand Down
2 changes: 0 additions & 2 deletions spec/acceptance/plugins_spec.rb
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
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
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.

33 changes: 33 additions & 0 deletions spec/classes/pulpcore_spec.rb
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
6 changes: 3 additions & 3 deletions spec/classes/repo_spec.rb
Expand Up @@ -9,9 +9,9 @@
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_anchor('pulpcore::repo') }
it { is_expected.to contain_yumrepo('pulpcore')
.with_baseurl(%r{https://yum.theforeman.org/pulpcore/\d+\.\d+/el\d+/\$basearch$})
.with_baseurl(%r{https://stagingyum.theforeman.org/pulpcore/\d+\.\d+/el\d+/\$basearch$})
.with_gpgcheck(1)
.with_gpgkey(%r{https://yum.theforeman.org/pulpcore/\d+\.\d+/GPG-RPM-KEY-pulpcore})
.with_gpgkey(%r{https://stagingyum.theforeman.org/pulpcore/\d+\.\d+/GPG-RPM-KEY-pulpcore})
.that_notifies('Anchor[pulpcore::repo]')
}
end
Expand All @@ -26,7 +26,7 @@

it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_yumrepo('pulpcore')
.with_baseurl(%r{https://yum.theforeman.org/pulpcore/nightly/el\d+/\$basearch$})
.with_baseurl(%r{https://stagingyum.theforeman.org/pulpcore/nightly/el\d+/\$basearch$})
.with_gpgcheck(0)
.that_notifies('Anchor[pulpcore::repo]')
}
Expand Down

0 comments on commit 6838c6e

Please sign in to comment.