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
4 changes: 3 additions & 1 deletion .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ fixtures:
certs: "https://github.com/theforeman/puppet-certs.git"
qpid: "https://github.com/theforeman/puppet-qpid.git"
pulp: "https://github.com/theforeman/puppet-pulp.git"
pulpcore: "https://github.com/theforeman/puppet-pulpcore.git"
pulpcore:
repo: "https://github.com/ekohl/puppet-pulpcore.git"
Copy link
Member Author

Choose a reason for hiding this comment

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

This obviously needs to be converted in an updated minimum version in metadata.json.

Copy link
Member Author

Choose a reason for hiding this comment

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

This needed to be changed before it was merged.

Copy link
Member Author

Choose a reason for hiding this comment

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

(pushed 45e251b directly to master)

branch: "apache-management"
postgresql: "https://github.com/puppetlabs/puppetlabs-postgresql"
redis: "https://github.com/voxpupuli/puppet-redis"
mongodb: "https://github.com/voxpupuli/puppet-mongodb.git"
Expand Down
62 changes: 33 additions & 29 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@
$foreman_url = $foreman_proxy::foreman_base_url
$reverse_proxy_real = $pulp or $reverse_proxy

# TODO: doesn't allow deploying a Pulp non-mirror without Foreman
$shared_with_foreman_vhost = ($pulpcore and !$pulpcore_mirror) or $pulp_master

$rhsm_port = $reverse_proxy_real ? {
true => $reverse_proxy_port,
false => 443
Expand Down Expand Up @@ -331,13 +334,33 @@
}
}

if $pulpcore and !$pulpcore_mirror {
include foreman::config::apache
if $pulpcore {
if $shared_with_foreman_vhost {
include foreman::config::apache
$servername = $foreman::config::apache::servername
$priority = $foreman::config::apache::priority
$apache_http_vhost = 'foreman'
$apache_https_vhost = 'foreman-ssl'
Class['foreman::config::apache'] -> Class['pulpcore::apache']
} elsif $pulp and $pulp::manage_httpd {
$servername = $facts['networking']['fqdn']
$priority = '05'
$apache_http_vhost = 'pulp-http'
$apache_https_vhost = 'pulp-https'
Class['pulp::apache'] -> Class['pulpcore::apache']
} else {
Copy link
Member

Choose a reason for hiding this comment

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

This else is stand-alone Pulpcore? aka a mirror?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, but without a Pulp 2 install. I haven't tested this branch yet, but I think you'll hit this if you spin up an EL8 proxy (if we provide the correct parameters).

$servername = undef
$priority = undef
$apache_http_vhost = undef
$apache_https_vhost = undef
}

class { 'pulpcore':
remote_user_environ_name => 'HTTP_REMOTE_USER',
manage_apache => false,
servername => $foreman::config::apache::servername,
apache_http_vhost => $apache_http_vhost,
apache_https_vhost => $apache_https_vhost,
apache_vhost_priority => $priority,
servername => $servername,
static_url => '/pulp/assets/',
postgresql_manage_db => $pulpcore_manage_postgresql,
postgresql_db_host => $pulpcore_postgresql_host,
postgresql_db_port => $pulpcore_postgresql_port,
Expand Down Expand Up @@ -370,32 +393,13 @@
}

include pulpcore::plugin::container
include pulpcore::plugin::file
include pulpcore::plugin::rpm
include pulpcore::plugin::certguard

foreman::config::apache::fragment { 'pulpcore':
content => template('foreman_proxy_content/pulpcore-content-apache.conf.erb'),
ssl_content => template(
'foreman_proxy_content/pulpcore-api-apache.conf.erb',
'foreman_proxy_content/pulpcore-content-apache.conf.erb',
'foreman_proxy_content/pulpcore-docker-apache.conf.erb'
),
}

if $proxy_pulp_isos_to_pulpcore {
foreman::config::apache::fragment { 'pulpcore-isos':
content => template('foreman_proxy_content/pulpcore-isos-apache.conf.erb'),
ssl_content => template('foreman_proxy_content/pulpcore-isos-apache.conf.erb'),
}
class { 'pulpcore::plugin::file':
use_pulp2_content_route => $proxy_pulp_isos_to_pulpcore,
}

if $proxy_pulp_yum_to_pulpcore {
foreman::config::apache::fragment { 'pulpcore-yum':
content => template('foreman_proxy_content/pulpcore-yum-apache.conf.erb'),
ssl_content => template('foreman_proxy_content/pulpcore-yum-apache.conf.erb'),
}
class { 'pulpcore::plugin::rpm':
use_pulp2_content_route => $proxy_pulp_yum_to_pulpcore,
}
include pulpcore::plugin::certguard
}

if $puppet {
Expand Down
2 changes: 1 addition & 1 deletion manifests/pub_dir.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

ensure_packages('katello-client-bootstrap')

if ($foreman_proxy_content::pulpcore or $foreman_proxy_content::pulp_master) {
if $foreman_proxy_content::shared_with_foreman_vhost {
include foreman::config::apache

foreman::config::apache::fragment { 'pub_dir':
Expand Down
16 changes: 5 additions & 11 deletions spec/classes/foreman_proxy_content_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,11 @@ class { 'foreman_proxy::plugin::pulp':

it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_class('foreman_proxy_content::pub_dir') }
it { is_expected.to contain_class('pulpcore').with(manage_apache: false).that_comes_before('Class[foreman_proxy::plugin::pulp]') }

it do
is_expected.to contain_foreman__config__apache__fragment('pulpcore')
.with_ssl_content(%r{ProxyPass /pulp/api/v3 http://127\.0\.0\.1:24817/pulp/api/v3})
.with_ssl_content(%r{ProxyPass /pulp/content http://127\.0\.0\.1:24816/pulp/content})
.with_ssl_content(%r{ProxyPass /pulpcore_registry/v2/ http://127\.0\.0\.1:24817/v2/})
.with_ssl_content(%r{ProxyPass /pulp/container/ http://127\.0\.0\.1:24816/pulp/container/})
.with_content(%r{ProxyPass /pulp/content http://127\.0\.0\.1:24816/pulp/content})
is_expected.to contain_foreman__config__apache__fragment('pulpcore-isos')
.with_content(%r{ProxyPass /pulp/isos http://127\.0\.0\.1:24816/pulp/content})
is_expected.to contain_class('pulpcore')
.with(apache_http_vhost: 'foreman')
.with(apache_https_vhost: 'foreman-ssl')
.that_comes_before('Class[foreman_proxy::plugin::pulp]')
end
end

Expand Down Expand Up @@ -182,7 +176,7 @@ class { 'foreman_proxy::plugin::pulp':
end

it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_class('pulpcore').with(manage_apache: false) }
it { is_expected.to contain_class('pulpcore') }

it do
is_expected.to contain_class('pulpcore::plugin::migration')
Expand Down
7 changes: 0 additions & 7 deletions templates/pulpcore-api-apache.conf.erb

This file was deleted.

7 changes: 0 additions & 7 deletions templates/pulpcore-content-apache.conf.erb

This file was deleted.

10 changes: 0 additions & 10 deletions templates/pulpcore-docker-apache.conf.erb

This file was deleted.

7 changes: 0 additions & 7 deletions templates/pulpcore-isos-apache.conf.erb

This file was deleted.

7 changes: 0 additions & 7 deletions templates/pulpcore-yum-apache.conf.erb

This file was deleted.