Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Support manage_httpd to allow Pulp in a standalone setup (followup) #337

Merged
merged 3 commits into from
May 4, 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
46 changes: 39 additions & 7 deletions manifests/pulp.pp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,18 @@
# @param pub_dir_options
# The Apache options to use on the `/pub` resource
#
# @param manage_vhost_standalone
# Boolean to manage the Pulp vhost standalone. Otherwise the vhost is managed as part of Foreman
#
# @param https_cert
# The Apache public certificate for ssl
#
# @param https_key
# The Apache private key for ssl
#
# @param https_ca_cert
# The Apache CA certificate for client authentication
#
class katello::pulp (
Optional[String] $yum_max_speed = undef,
Optional[Integer[1]] $num_workers = undef,
Expand All @@ -81,6 +93,10 @@
Optional[Enum['majority', 'all']] $mongodb_write_concern = undef,
Boolean $manage_mongodb = true,
String $pub_dir_options = '+FollowSymLinks +Indexes',
Boolean $manage_vhost_standalone = false,
Optional[Stdlib::Absolutepath] $https_cert = undef,
Optional[Stdlib::Absolutepath] $https_key = undef,
Optional[Stdlib::Absolutepath] $https_ca_cert = undef,
) {
include katello::params
include certs
Expand All @@ -92,12 +108,25 @@

include apache

# Deploy as a part of the foreman vhost
include foreman::config::apache
$server_name = $foreman::config::apache::servername
foreman::config::apache::fragment { 'pulp':
content => template('katello/pulp-apache.conf.erb'),
ssl_content => template('katello/pulp-apache-ssl.conf.erb'),
if $manage_vhost_standalone {
$server_name = undef

concat::fragment { 'httpd_pub':
target => '05-pulp-http.conf',
content => template('katello/pulp-apache.conf.erb'),
}

pulp::apache::fragment { 'httpd_ssl_pub':
ssl_content => template('katello/pulp-apache-ssl.conf.erb'),
}
} else {
# Deploy as a part of the foreman vhost
include foreman::config::apache
$server_name = $foreman::config::apache::servername
foreman::config::apache::fragment { 'pulp':
content => template('katello/pulp-apache.conf.erb'),
ssl_content => template('katello/pulp-apache-ssl.conf.erb'),
}
}

Anchor <| title == 'katello::repo' |> -> # lint:ignore:anchor_resource
Expand All @@ -112,7 +141,10 @@
broker_use_ssl => true,
yum_max_speed => $yum_max_speed,
manage_broker => false,
manage_httpd => false,
manage_httpd => $manage_vhost_standalone,
https_cert => $https_cert,
https_key => $https_key,
https_ca_cert => $https_ca_cert,
manage_plugins_httpd => true,
manage_squid => true,
enable_rpm => $katello::params::enable_yum,
Expand Down
11 changes: 11 additions & 0 deletions spec/classes/pulp_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,17 @@
.with_db_password('pulp_pw')
.with_db_seeds('192.168.1.1:27017')
end

context 'with manage_httpd => true' do
let :params do
super().merge({ 'manage_vhost_standalone' => true, })
end

it do
is_expected.to create_class('pulp')
.with_manage_httpd(true)
end
end
end
end
end
Expand Down