Skip to content
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
21 changes: 21 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,16 @@
# mongo database has slow I/O, then setting a higher number may resolve issues where workers are
# going missing incorrectly.
#
# $pulpcore_manage_postgresql:: Manage the pulpcore postgresql database
#
# $pulpcore_postgresql_host:: Host of the pulpcore postgresql database. Must be specified if external/unmanaged.
#
# $pulpcore_postgresql_port:: Port of the pulpcore postgresql database.
#
# $pulpcore_postgresql_user:: User of the pulpcore postgresql database.
#
# $pulpcore_postgresql_password:: Password of the pulpcore postgresql database.
#
class foreman_proxy_content (
String[1] $parent_fqdn = $foreman_proxy_content::params::parent_fqdn,
String $pulp_admin_password = $foreman_proxy_content::params::pulp_admin_password,
Expand Down Expand Up @@ -134,6 +144,12 @@
Boolean $enable_deb = $foreman_proxy_content::params::enable_deb,

Boolean $manage_broker = $foreman_proxy_content::params::manage_broker,

Boolean $pulpcore_manage_postgresql = $foreman_proxy_content::params::pulpcore_manage_postgresql,
Stdlib::Host $pulpcore_postgresql_host = $foreman_proxy_content::params::pulpcore_postgresql_host,
Stdlib::Port $pulpcore_postgresql_port = $foreman_proxy_content::params::pulpcore_postgresql_port,
String $pulpcore_postgresql_user = $foreman_proxy_content::params::pulpcore_postgresql_user,
String $pulpcore_postgresql_password = $foreman_proxy_content::params::pulpcore_postgresql_password,
) inherits foreman_proxy_content::params {
include certs
include foreman_proxy
Expand Down Expand Up @@ -296,6 +312,11 @@
remote_user_environ_name => 'HTTP_REMOTE_USER',
manage_apache => false,
servername => $foreman::servername,
postgresql_manage_db => $pulpcore_manage_postgresql,
postgresql_db_host => $pulpcore_postgresql_host,
postgresql_db_port => $pulpcore_postgresql_port,
postgresql_db_user => $pulpcore_postgresql_user,
postgresql_db_password => $pulpcore_postgresql_password,
}

if $pulp_master {
Expand Down
104 changes: 55 additions & 49 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,53 +2,59 @@
class foreman_proxy_content::params {

# when not specified, we expect all in one installation
$parent_fqdn = $facts['fqdn']

$reverse_proxy = false
$reverse_proxy_port = 8443

$ssl_protocol = undef

$certs_tar = undef
$rhsm_hostname = undef
$rhsm_url = '/rhsm'

$puppet = true

$pulp_admin_password = extlib::cache_data('foreman_cache_data', 'pulp_node_admin_password', extlib::random_password(32))
$pulp_max_speed = undef
$pulp_num_workers = undef
$pulp_proxy_password = undef
$pulp_proxy_port = undef
$pulp_proxy_url = undef
$pulp_proxy_username = undef
$pulp_puppet_wsgi_processes = 1
$pulp_ca_cert = undef
$pulp_worker_timeout = 60

$qpid_router = true
$qpid_router_agent_addr = undef
$qpid_router_agent_port = 5647
$qpid_router_broker_addr = 'localhost'
$qpid_router_broker_port = 5671
$qpid_router_hub_addr = undef
$qpid_router_hub_port = 5646
$qpid_router_logging_level = 'info+'
$qpid_router_logging = 'syslog'
$qpid_router_logging_path = '/var/log/qdrouterd'
$qpid_router_ssl_ciphers = undef
$qpid_router_ssl_protocols = undef
$qpid_router_sasl_mech = 'PLAIN'
$qpid_router_sasl_username = 'katello_agent'
$qpid_router_sasl_password = extlib::cache_data('foreman_cache_data', 'qpid_router_sasl_password', extlib::random_password(16))

$enable_ostree = false
$enable_yum = true
$enable_file = true
$proxy_pulp_isos_to_pulpcore = true
$enable_puppet = true
$enable_docker = true
$enable_deb = true

$manage_broker = true
$parent_fqdn = $facts['fqdn']

$reverse_proxy = false
$reverse_proxy_port = 8443

$ssl_protocol = undef

$certs_tar = undef
$rhsm_hostname = undef
$rhsm_url = '/rhsm'

$puppet = true

$pulp_admin_password = extlib::cache_data('foreman_cache_data', 'pulp_node_admin_password', extlib::random_password(32))
$pulp_max_speed = undef
$pulp_num_workers = undef
$pulp_proxy_password = undef
$pulp_proxy_port = undef
$pulp_proxy_url = undef
$pulp_proxy_username = undef
$pulp_puppet_wsgi_processes = 1
$pulp_ca_cert = undef
$pulp_worker_timeout = 60

$qpid_router = true
$qpid_router_agent_addr = undef
$qpid_router_agent_port = 5647
$qpid_router_broker_addr = 'localhost'
$qpid_router_broker_port = 5671
$qpid_router_hub_addr = undef
$qpid_router_hub_port = 5646
$qpid_router_logging_level = 'info+'
$qpid_router_logging = 'syslog'
$qpid_router_logging_path = '/var/log/qdrouterd'
$qpid_router_ssl_ciphers = undef
$qpid_router_ssl_protocols = undef
$qpid_router_sasl_mech = 'PLAIN'
$qpid_router_sasl_username = 'katello_agent'
$qpid_router_sasl_password = extlib::cache_data('foreman_cache_data', 'qpid_router_sasl_password', extlib::random_password(16))

$enable_ostree = false
$enable_yum = true
$enable_file = true
$proxy_pulp_isos_to_pulpcore = true
$enable_puppet = true
$enable_docker = true
$enable_deb = true

$manage_broker = true

$pulpcore_manage_postgresql = true
$pulpcore_postgresql_host = 'localhost'
$pulpcore_postgresql_port = 5432
$pulpcore_postgresql_user = 'pulp'
$pulpcore_postgresql_password = extlib::cache_data('pulpcore_cache_data', 'db_password', extlib::random_password(32))
}
38 changes: 36 additions & 2 deletions spec/classes/foreman_proxy_content_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ class { 'foreman_proxy::plugin::pulp':
<<-PUPPET
include foreman_proxy
class { 'foreman_proxy::plugin::pulp':
pulpcore_enabled => true,
pulpcore_mirror => false,
pulpcore_enabled => true,
pulpcore_mirror => false,
}
PUPPET
end
Expand All @@ -71,6 +71,40 @@ class { 'foreman_proxy::plugin::pulp':
end
end

context 'pulpcore with external postgres' do
let(:params) do
{
qpid_router: false,
pulpcore_manage_postgresql: false,
pulpcore_postgresql_host: 'postgres-pulpcore.example.com',
pulpcore_postgresql_port: 2345,
pulpcore_postgresql_user: 'pulpuser',
pulpcore_postgresql_password: 'sUpersEkret'
}
end

let(:pre_condition) do
<<-PUPPET
include foreman_proxy
class { 'foreman_proxy::plugin::pulp':
pulpcore_enabled => true,
pulpcore_mirror => false,
}
PUPPET
end

it { is_expected.to compile.with_all_deps }

it do
is_expected.to contain_class('pulpcore')
.with_postgresql_manage_db(false)
.with_postgresql_db_host('postgres-pulpcore.example.com')
.with_postgresql_db_port(2345)
.with_postgresql_db_user('pulpuser')
.with_postgresql_db_password('sUpersEkret')
end
end

context 'pulp-2to3-migration' do
let(:params) do
{
Expand Down