Skip to content

Commit

Permalink
Fixes #31642 - Add container gateway support
Browse files Browse the repository at this point in the history
  • Loading branch information
ianballou committed Jan 29, 2021
1 parent e4b7763 commit fb30601
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
37 changes: 37 additions & 0 deletions manifests/plugin/container_gateway.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# = Foreman Proxy Container Gateway plugin
#
# This class installs the Container Gateway plugin
#
# $pulp_endpoint:: Pulp 3 server endpoint
#
# $pulp_client_ssl_cert:: X509 certificate for authenticating with Pulp
#
# $pulp_client_ssl_key:: RSA private key for the Pulp certificate
#
# $sqlite_db_path:: Absolute path for the SQLite DB file to exist at
#
# === Advanced parameters:
#
# $enabled:: enables/disables the pulp plugin
#
# $listen_on:: proxy feature listens on http, https, or both
#
# $version:: plugin package version, it's passed to ensure parameter of package resource
# can be set to specific version number, 'latest', 'present' etc.
#
class foreman_proxy::plugin::container_gateway (
Optional[String] $version = $foreman_proxy::plugin::container_gateway::params::version,
Boolean $enabled = $foreman_proxy::plugin::container_gateway::params::enabled,
Foreman_proxy::ListenOn $listen_on = $foreman_proxy::plugin::container_gateway::params::listen_on,
Stdlib::HTTPUrl $pulp_endpoint = $foreman_proxy::plugin::container_gateway::params::pulp_endpoint,
Stdlib::Absolutepath $pulp_client_ssl_cert = $foreman_proxy::plugin::container_gateway::params::pulp_ssl_client_cert,
Stdlib::Absolutepath $pulp_client_ssl_key = $foreman_proxy::plugin::container_gateway::params::pulp_ssl_client_key,
Stdlib::Absolutepath $sqlite_db_path = $foreman_proxy::plugin::container_gateway::params::sqlite_db_path,
) inherits foreman_proxy::plugin::container_gateway::params {
foreman_proxy::plugin::module { 'container_gateway':
version => $version,
enabled => $enabled,
feature => 'Container_Gateway',
listen_on => $listen_on,
}
}
11 changes: 11 additions & 0 deletions manifests/plugin/container_gateway/params.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Default parameters for the Container Gateway smart proxy plugin
# @api private
class foreman_proxy::plugin::container_gateway::params {
$enabled = true
$listen_on = 'https'
$version = undef
$pulp_endpoint = "https://${facts['networking']['fqdn']}"
$pulp_ssl_client_cert = '/etc/foreman-proxy/foreman_ssl_cert.pem'
$pulp_ssl_client_key = '/etc/foreman-proxy/foreman_ssl_key.pem'
$sqlite_db_path = '/var/lib/foreman-proxy/smart_proxy_container_gateway.db'
}
7 changes: 7 additions & 0 deletions templates/plugin/container_gateway.yml.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# Container Gateway for Katello
:enabled: <%= @module_enabled %>
:pulp_endpoint: <%= scope.lookupvar("foreman_proxy::plugin::container_gateway::pulp_endpoint") %>
:pulp_client_ssl_cert: <%= scope.lookupvar("foreman_proxy::plugin::container_gateway::pulp_ssl_client_cert") %>
:pulp_client_ssl_key: <%= scope.lookupvar("foreman_proxy::plugin::container_gateway::pulp_ssl_client_key") %>
:sqlite_db_path: <%= scope.lookupvar("foreman_proxy::plugin::container_gateway::sqlite_db_path") %>

0 comments on commit fb30601

Please sign in to comment.