Skip to content

Commit

Permalink
Add Pulp 3 HTTP URLs
Browse files Browse the repository at this point in the history
This matches the pulp3.yml.example file with defaults that match what
theforeman-foreman_proxy_content deploys.
  • Loading branch information
ekohl committed Dec 13, 2019
1 parent cd99718 commit f26cd25
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
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
#
# $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: http://localhost:24817/pulp/api",
":content_app_url: http://localhost:24816/pulp/content",
':mirror: false'
])
end
Expand All @@ -75,6 +74,8 @@
pulpnode_enabled: true,
pulp3_enabled: true,
pulp3_mirror: true,
pulp3_api_url: 'https://pulp.example.com/pulp/api',
pulp3_content_url: 'https://pulp.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://pulp.example.com/pulp/api',
":content_app_url: https://pulp.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") %>

0 comments on commit f26cd25

Please sign in to comment.