Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Certguard and File installation as plugin #336

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also keep this @ekohl ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd imagine so. These are endpoints that Pulp 2 users can use continue using.

# @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
Original file line number Diff line number Diff line change
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
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.

33 changes: 33 additions & 0 deletions spec/classes/pulpcore_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -651,11 +651,44 @@
}
end

it 'allows configuring more workers than processors' do

Check failure on line 654 in spec/classes/pulpcore_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

pulpcore on centos-8-x86_64 configured for 12 workers and only 8 processors allows configuring more workers than processors Failure/Error: 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 `context` is not available from within an example (e.g. an `it` block) or from constructs that run in the scope of an example (e.g. `before`, `let`, etc). It is only available on an example group (e.g. a `describe` or `context` block).

Check failure on line 654 in spec/classes/pulpcore_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

pulpcore on centos-9-x86_64 configured for 12 workers and only 8 processors allows configuring more workers than processors Failure/Error: 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 `context` is not available from within an example (e.g. an `it` block) or from constructs that run in the scope of an example (e.g. `before`, `let`, etc). It is only available on an example group (e.g. a `describe` or `context` block).

Check failure on line 654 in spec/classes/pulpcore_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

pulpcore on redhat-8-x86_64 configured for 12 workers and only 8 processors allows configuring more workers than processors Failure/Error: 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 `context` is not available from within an example (e.g. an `it` block) or from constructs that run in the scope of an example (e.g. `before`, `let`, etc). It is only available on an example group (e.g. a `describe` or `context` block).

Check failure on line 654 in spec/classes/pulpcore_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

pulpcore on redhat-9-x86_64 configured for 12 workers and only 8 processors allows configuring more workers than processors Failure/Error: 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 `context` is not available from within an example (e.g. an `it` block) or from constructs that run in the scope of an example (e.g. `before`, `let`, etc). It is only available on an example group (e.g. a `describe` or `context` block).

Check failure on line 654 in spec/classes/pulpcore_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

pulpcore on centos-9-x86_64 configured for 12 workers and only 8 processors allows configuring more workers than processors Failure/Error: 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 `context` is not available from within an example (e.g. an `it` block) or from constructs that run in the scope of an example (e.g. `before`, `let`, etc). It is only available on an example group (e.g. a `describe` or `context` block).

Check failure on line 654 in spec/classes/pulpcore_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

pulpcore on redhat-8-x86_64 configured for 12 workers and only 8 processors allows configuring more workers than processors Failure/Error: 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 `context` is not available from within an example (e.g. an `it` block) or from constructs that run in the scope of an example (e.g. `before`, `let`, etc). It is only available on an example group (e.g. a `describe` or `context` block).

Check failure on line 654 in spec/classes/pulpcore_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

pulpcore on centos-8-x86_64 configured for 12 workers and only 8 processors allows configuring more workers than processors Failure/Error: 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 `context` is not available from within an example (e.g. an `it` block) or from constructs that run in the scope of an example (e.g. `before`, `let`, etc). It is only available on an example group (e.g. a `describe` or `context` block).

Check failure on line 654 in spec/classes/pulpcore_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

pulpcore on redhat-9-x86_64 configured for 12 workers and only 8 processors allows configuring more workers than processors Failure/Error: 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 `context` is not available from within an example (e.g. an `it` block) or from constructs that run in the scope of an example (e.g. `before`, `let`, etc). It is only available on an example group (e.g. a `describe` or `context` block).
(1..12).each do |i|
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
Original file line number Diff line number Diff line change
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
Loading