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

Add Pulp 3 HTTP URLs #549

Merged
merged 1 commit into from
Dec 13, 2019
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
6 changes: 6 additions & 0 deletions manifests/plugin/pulp.pp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
#
# $pulp3_mirror:: Whether this pulp3 plugin acts as a mirror or another pulp node. A pulp3 mirror is the pulp3 equivalent of a pulpnode.
#
# $pulp3_api_url:: The URL to the Pulp 3 API
#
# $pulp3_content_url:: The URL to the Pulp 3 content
Copy link
Member

Choose a reason for hiding this comment

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

We've already used this convention in a few places, but in others we've identified that the use of pulp3 may come back to bite us and used 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.

I don't mind renaming. Most of these predate the pulpcore convention. In https://github.com/theforeman/smart_proxy_pulp/ it's also the pulp3 module.

Copy link
Member

Choose a reason for hiding this comment

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

Let's merge this and I'll raise an issue here to discuss further.

#
# $puppet_content_dir:: directory for puppet content
#
# $mongodb_dir:: directory for Mongo DB
Expand All @@ -34,6 +38,8 @@
Foreman_proxy::ListenOn $listen_on = $::foreman_proxy::plugin::pulp::params::listen_on,
Boolean $pulpnode_enabled = $::foreman_proxy::plugin::pulp::params::pulpnode_enabled,
Boolean $pulp3_enabled = $::foreman_proxy::plugin::pulp::params::pulp3_enabled,
Stdlib::HTTPUrl $pulp3_api_url = $::foreman_proxy::plugin::pulp::params::pulp3_api_url,
Stdlib::HTTPUrl $pulp3_content_url = $::foreman_proxy::plugin::pulp::params::pulp3_content_url,
Boolean $pulp3_mirror = $::foreman_proxy::plugin::pulp::params::pulp3_mirror,
Optional[String] $version = $::foreman_proxy::plugin::pulp::params::version,
Optional[String] $group = $::foreman_proxy::plugin::pulp::params::group,
Expand Down
2 changes: 2 additions & 0 deletions manifests/plugin/pulp/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
$pulp3_enabled = false
$pulp3_mirror = false
$pulp_url = "https://${::fqdn}/pulp"
$pulp3_api_url = "${pulp_url}/api"
$pulp3_content_url = "${pulp_url}/content"
$pulp_dir = '/var/lib/pulp'
$pulp_content_dir = '/var/lib/pulp/content'
$puppet_content_dir = pick($::puppet_environmentpath, "${::foreman_proxy::params::puppetdir}/environments")
Expand Down
12 changes: 6 additions & 6 deletions spec/classes/foreman_proxy__plugin__pulp_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,8 @@
verify_exact_contents(catalogue, "#{etc_dir}/foreman-proxy/settings.d/pulp3.yml", [
'---',
':enabled: false',
":pulp_url: https://#{facts[:fqdn]}/pulp",
':pulp_dir: /var/lib/pulp',
':pulp_content_dir: /var/lib/pulp/content',
":pulp_url: https://#{facts[:fqdn]}/pulp/api",
":content_app_url: https://#{facts[:fqdn]}/pulp/content",
':mirror: false'
])
end
Expand All @@ -75,6 +74,8 @@
pulpnode_enabled: true,
pulp3_enabled: true,
pulp3_mirror: true,
pulp3_api_url: 'https://pulp3.example.com/pulp/api',
pulp3_content_url: 'https://pulp3.example.com/pulp/content',
pulp_url: 'https://pulp.example.com',
pulp_dir: '/tmp/pulp',
pulp_content_dir: '/tmp/content',
Expand Down Expand Up @@ -128,9 +129,8 @@
verify_exact_contents(catalogue, "#{etc_dir}/foreman-proxy/settings.d/pulp3.yml", [
'---',
':enabled: https',
':pulp_url: https://pulp.example.com',
':pulp_dir: /tmp/pulp',
':pulp_content_dir: /tmp/content',
':pulp_url: https://pulp3.example.com/pulp/api',
":content_app_url: https://pulp3.example.com/pulp/content",
':mirror: true'
])
end
Expand Down
6 changes: 2 additions & 4 deletions templates/plugin/pulp3.yml.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
---
# Pulp integration
:enabled: <%= @module_enabled %>
:pulp_url: <%= scope.lookupvar("foreman_proxy::plugin::pulp::pulp_url") %>
:pulp_dir: <%= scope.lookupvar("foreman_proxy::plugin::pulp::pulp_dir") %>
:pulp_content_dir: <%= scope.lookupvar("foreman_proxy::plugin::pulp::pulp_content_dir") %>
:pulp_url: <%= scope.lookupvar("foreman_proxy::plugin::pulp::pulp3_api_url") %>
:content_app_url: <%= scope.lookupvar("foreman_proxy::plugin::pulp::pulp3_content_url") %>
:mirror: <%= scope.lookupvar("foreman_proxy::plugin::pulp::pulp3_mirror") %>