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

Refs #30023: Enable Pulpcore RPM plugin #261

Merged
merged 1 commit into from
Jun 8, 2020
Merged
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
13 changes: 12 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
#
# $proxy_pulp_isos_to_pulpcore:: Proxy /pulp/isos to Pulpcore at /pulp/content
#
# $proxy_pulp_yum_to_pulpcore:: Proxy /pulp/yum to Pulpcore at /pulp/content
#
# $reverse_proxy:: Add reverse proxy to the parent
#
# $reverse_proxy_port:: Reverse proxy listening port
Expand Down Expand Up @@ -149,6 +151,7 @@
Boolean $enable_yum = $foreman_proxy_content::params::enable_yum,
Boolean $enable_file = $foreman_proxy_content::params::enable_file,
Boolean $proxy_pulp_isos_to_pulpcore = $foreman_proxy_content::params::proxy_pulp_isos_to_pulpcore,
Boolean $proxy_pulp_yum_to_pulpcore = $foreman_proxy_content::params::proxy_pulp_yum_to_pulpcore,
wbclark marked this conversation as resolved.
Show resolved Hide resolved
Boolean $enable_puppet = $foreman_proxy_content::params::enable_puppet,
Boolean $enable_docker = $foreman_proxy_content::params::enable_docker,
Boolean $enable_deb = $foreman_proxy_content::params::enable_deb,
Expand Down Expand Up @@ -287,7 +290,7 @@

class { 'pulp':
enable_ostree => $enable_ostree,
enable_rpm => $enable_yum,
enable_rpm => $enable_yum and !$proxy_pulp_yum_to_pulpcore,
Copy link
Member

Choose a reason for hiding this comment

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

Not really for this PR, but this made me think of it: we don't have conditional to disable crane if we proxy container content to Pulpcore.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yea, I think we just were leaning towards leave Crane alone till we can safely rip it out.

enable_iso => $enable_file and !$proxy_pulp_isos_to_pulpcore,
enable_deb => $enable_deb,
enable_puppet => $enable_puppet,
Expand Down Expand Up @@ -363,6 +366,7 @@

include pulpcore::plugin::container
include pulpcore::plugin::file
include pulpcore::plugin::rpm
Copy link
Member

Choose a reason for hiding this comment

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

general question: shouldn't those plugin includes (at least file and rpm) be inside the respective "proxy to pulpcore" blocks? as otherwise we'd be installing the pulpcore plugin but not using it, which seems like a waste?

Copy link
Member

Choose a reason for hiding this comment

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

The idea is that the plugin is installed. This allows you to migrate content from Pulp 2. Also the Pulp 3 content URLs are always available. The "proxy to pulpcore" blocks are about routing the old Pulp 2 URLs to Pulp 3 so clients don't have to be modified. Ideally they should, but this allows to do so at a convenient pace.


foreman::config::apache::fragment { 'pulpcore':
content => template('foreman_proxy_content/pulpcore-content-apache.conf.erb'),
Expand All @@ -379,6 +383,13 @@
ssl_content => template('foreman_proxy_content/pulpcore-isos-apache.conf.erb'),
}
}

if $proxy_pulp_yum_to_pulpcore {
foreman::config::apache::fragment { 'pulpcore-yum':
content => template('foreman_proxy_content/pulpcore-yum-apache.conf.erb'),
ssl_content => template('foreman_proxy_content/pulpcore-yum-apache.conf.erb'),
}
}
}

if $puppet {
Expand Down
1 change: 1 addition & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
$enable_yum = true
$enable_file = true
$proxy_pulp_isos_to_pulpcore = true
$proxy_pulp_yum_to_pulpcore = true
$enable_puppet = true
$enable_docker = true
$enable_deb = true
Expand Down
2 changes: 2 additions & 0 deletions templates/pulpcore-yum-apache.conf.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ProxyPass /pulp/repos <%= scope['pulpcore::apache::content_url'] %>
ProxyPassReverse /pulp/repos <%= scope['pulpcore::apache::content_url'] %>