diff --git a/manifests/broker.pp b/manifests/broker.pp deleted file mode 100644 index 68d709d6..00000000 --- a/manifests/broker.pp +++ /dev/null @@ -1,22 +0,0 @@ -# @summary Manages a standalone qpid broker for pulp -# -# In Katello, the master pulp instance uses Katello's main qpid message broker. -# This can be used for a separate pulp instance that also needs a broker of its -# own. -# -# @param interface -# The interface the broker listens on -class foreman_proxy_content::broker ( - String $interface = 'lo', -) { - include certs::qpid - - class { 'qpid': - ssl => true, - ssl_cert_db => $certs::nss_db_dir, - ssl_cert_password_file => $certs::qpid::nss_db_password_file, - ssl_cert_name => 'broker', - interface => $interface, - subscribe => Class['certs', 'certs::qpid'], - } -} diff --git a/manifests/init.pp b/manifests/init.pp index 87da3d2b..c399ca35 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -4,46 +4,20 @@ # # === Parameters: # -# $enable_ostree:: Enable ostree content plugin, this requires an ostree install -# # $enable_yum:: Enable rpm content plugin, including syncing of yum content # # $enable_file:: Enable file content plugin # -# $enable_puppet:: Enable puppet content plugin -# # $enable_docker:: Enable docker content plugin # # $enable_deb:: Enable debian content plugin # +# $pulpcore_mirror:: Deploy Pulp to be used as a mirror +# # === Advanced parameters: # # $puppet:: Enable puppet # -# $pulp_admin_password:: Password for the Pulp admin user. It should be left blank so that a random password is generated -# -# $pulp_max_speed:: The maximum download speed per second for a Pulp task, such as a sync. (e.g. "4 Kb" (Uses SI KB), 4MB, or 1GB" ) -# -# $pulp_num_workers:: Number of Pulp workers to use. -# -# $pulp_proxy_port:: Port of the http proxy server -# -# $pulp_proxy_url:: URL of the http proxy server -# -# $pulp_proxy_username:: Proxy username for authentication -# -# $pulp_proxy_password:: Proxy password for authentication -# -# $pulp_puppet_wsgi_processes:: Number of WSGI processes to spawn for the puppet webapp -# -# $pulp_ca_cert:: Absolute path to PEM encoded CA certificate file, used by Pulp to validate the identity of the broker using SSL. -# -# $proxy_pulp_deb_to_pulpcore:: Proxy /pulp/deb to Pulpcore at /pulp/content -# -# $proxy_pulp_isos_to_pulpcore:: Proxy /pulp/isos to Pulpcore at /pulp/content -# -# $proxy_pulp_yum_to_pulpcore:: Proxy /pulp/yum to Pulpcore at /pulp/content -# # $reverse_proxy:: Add reverse proxy to the parent # # $reverse_proxy_port:: Reverse proxy listening port @@ -78,12 +52,6 @@ # # $qpid_router_sasl_password:: SASL password to be used from router to broker # -# $manage_broker:: Manage the qpid message broker when applicable -# -# $pulp_worker_timeout:: The amount of time (in seconds) before considering a worker as missing. If Pulp's -# 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. @@ -112,16 +80,7 @@ # incrementally with benchmarking at each step to determine an optimal value for your deployment. # class foreman_proxy_content ( - String $pulp_admin_password = $foreman_proxy_content::params::pulp_admin_password, - Optional[String] $pulp_max_speed = undef, - Optional[Integer[1]] $pulp_num_workers = undef, - Optional[String] $pulp_proxy_password = undef, - Optional[Stdlib::Port] $pulp_proxy_port = undef, - Optional[String] $pulp_proxy_url = undef, - Optional[String] $pulp_proxy_username = undef, - Integer[1] $pulp_puppet_wsgi_processes = 1, - Optional[Stdlib::Absolutepath] $pulp_ca_cert = undef, - Integer[0] $pulp_worker_timeout = 60, + Boolean $pulpcore_mirror = false, Boolean $puppet = true, @@ -143,18 +102,12 @@ Optional[String] $qpid_router_sasl_mech = 'PLAIN', Optional[String] $qpid_router_sasl_username = 'katello_agent', Optional[String] $qpid_router_sasl_password = $foreman_proxy_content::params::qpid_router_sasl_password, - Boolean $enable_ostree = false, + Boolean $enable_yum = true, Boolean $enable_file = true, - Boolean $proxy_pulp_deb_to_pulpcore = true, - Boolean $proxy_pulp_isos_to_pulpcore = true, - Boolean $proxy_pulp_yum_to_pulpcore = true, - Boolean $enable_puppet = true, Boolean $enable_docker = true, Boolean $enable_deb = true, - Boolean $manage_broker = true, - Boolean $pulpcore_manage_postgresql = true, Stdlib::Host $pulpcore_postgresql_host = 'localhost', Stdlib::Port $pulpcore_postgresql_port = 5432, @@ -170,23 +123,13 @@ ) inherits foreman_proxy_content::params { include certs include foreman_proxy - include foreman_proxy::plugin::pulp - - $pulp_master = $foreman_proxy::plugin::pulp::enabled - $pulp = $foreman_proxy::plugin::pulp::pulpnode_enabled - $pulpcore_mirror = $foreman_proxy::plugin::pulp::pulpcore_mirror - $pulpcore = $foreman_proxy::plugin::pulp::pulpcore_enabled - - $enable_pulp2_rpm = $enable_yum and !($pulpcore and $proxy_pulp_yum_to_pulpcore) - $enable_pulp2_iso = $enable_file and !($pulpcore and $proxy_pulp_isos_to_pulpcore) - $enable_pulp2_deb = $enable_deb and !($pulpcore and $proxy_pulp_deb_to_pulpcore) $foreman_url = $foreman_proxy::foreman_base_url $foreman_host = foreman_proxy_content::host_from_url($foreman_url) - $reverse_proxy_real = ($pulp or $pulpcore_mirror) or $reverse_proxy + $reverse_proxy_real = $pulpcore_mirror 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 + $shared_with_foreman_vhost = !$pulpcore_mirror $rhsm_port = $reverse_proxy_real ? { true => $reverse_proxy_port, @@ -195,10 +138,6 @@ ensure_packages('katello-debug') - if ($pulp_master or $pulp) and $facts['os']['release']['major'] != '7' { - fail('Pulp 2 is only supported on CentOS 7') - } - class { 'certs::foreman_proxy': notify => Service['foreman-proxy'], } @@ -214,7 +153,9 @@ } } - if $pulp_master or $pulp { + include foreman_proxy_content::pub_dir + + if $facts['os']['release']['major'] == '7' { if $qpid_router { class { 'foreman_proxy_content::dispatch_router': agent_addr => $qpid_router_agent_addr, @@ -227,7 +168,13 @@ } contain foreman_proxy_content::dispatch_router - if $pulp_master { + if $pulpcore_mirror { + class { 'foreman_proxy_content::dispatch_router::connector': + host => $foreman_host, + port => $qpid_router_hub_port, + } + contain foreman_proxy_content::dispatch_router::connector + } else { class { 'foreman_proxy_content::dispatch_router::hub': hub_addr => $qpid_router_hub_addr, hub_port => $qpid_router_hub_port, @@ -238,193 +185,101 @@ sasl_password => $qpid_router_sasl_password, } contain foreman_proxy_content::dispatch_router::hub - } else { - class { 'foreman_proxy_content::dispatch_router::connector': - host => $foreman_host, - port => $qpid_router_hub_port, - } - contain foreman_proxy_content::dispatch_router::connector } } - - include certs::apache - class { 'pulp::crane': - cert => $certs::apache::apache_cert, - key => $certs::apache::apache_key, - ssl_chain => $certs::katello_server_ca_cert, - ca_cert => $certs::katello_default_ca_cert, - data_dir => '/var/lib/pulp/published/docker/v2/app', - require => Class['certs::apache'], - } - } - include foreman_proxy_content::pub_dir - - if $pulp { - include apache + if $pulpcore_mirror { + $pulpcore_allowed_import_path = ['/var/lib/pulp/sync_imports'] + $pulpcore_allowed_export_path = [] - file {'/etc/httpd/conf.d/pulp_nodes.conf': - ensure => file, - content => template('foreman_proxy_content/pulp_nodes.conf.erb'), - owner => 'root', - group => 'root', - mode => '0644', - } - - if $manage_broker { - include foreman_proxy_content::broker - } - - class { 'certs::qpid_client': - require => Class['pulp::install'], - notify => Class['pulp::service'], + pulpcore::apache::fragment{'gpg_key_proxy': + https_content => template('foreman_proxy_content/_pulp_gpg_proxy.erb'), } + } else { + $pulpcore_allowed_import_path = ['/var/lib/pulp/sync_imports', '/var/lib/pulp/imports'] + $pulpcore_allowed_export_path = ['/var/lib/pulp/exports'] + } - class { 'pulp': - enable_ostree => $enable_ostree, - enable_rpm => $enable_pulp2_rpm, - enable_iso => $enable_pulp2_iso, - enable_deb => $enable_pulp2_deb, - enable_puppet => $enable_puppet, - enable_docker => $enable_docker, - enable_http => true, - default_password => $pulp_admin_password, - messaging_transport => 'qpid', - messaging_auth_enabled => false, - messaging_ca_cert => pick($pulp_ca_cert, $certs::qpid_client::qpid_client_ca_cert), - messaging_client_cert => $certs::qpid_client::qpid_client_cert, - messaging_url => "ssl://${qpid_router_broker_addr}:${qpid_router_broker_port}", - broker_url => "qpid://${qpid_router_broker_addr}:${qpid_router_broker_port}", - broker_use_ssl => true, - manage_broker => false, - manage_httpd => true, - manage_plugins_httpd => true, - manage_squid => true, - puppet_wsgi_processes => $pulp_puppet_wsgi_processes, - num_workers => $pulp_num_workers, - repo_auth => true, - https_cert => $certs::apache::apache_cert, - https_key => $certs::apache::apache_key, - https_chain => $certs::apache::apache_ca_cert, - https_ca_cert => $certs::ca_cert, - yum_max_speed => $pulp_max_speed, - proxy_port => $pulp_proxy_port, - proxy_url => $pulp_proxy_url, - proxy_username => $pulp_proxy_username, - proxy_password => $pulp_proxy_password, - worker_timeout => $pulp_worker_timeout, - } + 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' + $apache_https_cert = undef + $apache_https_key = undef + $apache_https_ca = undef + $apache_https_chain = undef + Class['foreman::config::apache'] -> Class['pulpcore::apache'] + } else { + include certs::apache + Class['certs::apache'] ~> Class['pulpcore::apache'] + $servername = $certs::apache::hostname + $priority = undef + $apache_http_vhost = undef + $apache_https_vhost = undef + $apache_https_cert = $certs::apache::apache_cert + $apache_https_key = $certs::apache::apache_key + $apache_https_ca = $certs::katello_default_ca_cert + $apache_https_chain = $certs::katello_server_ca_cert + } - pulp::apache::fragment{'gpg_key_proxy': - ssl_content => template('foreman_proxy_content/_pulp_gpg_proxy.erb'), - } + class { 'pulpcore': + allowed_import_path => $pulpcore_allowed_import_path, + allowed_export_path => $pulpcore_allowed_export_path, + apache_http_vhost => $apache_http_vhost, + apache_https_vhost => $apache_https_vhost, + apache_https_cert => $apache_https_cert, + apache_https_key => $apache_https_key, + apache_https_ca => $apache_https_ca, + apache_https_chain => $apache_https_chain, + 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, + postgresql_db_user => $pulpcore_postgresql_user, + postgresql_db_password => $pulpcore_postgresql_password, + postgresql_db_name => $pulpcore_postgresql_db_name, + postgresql_db_ssl => $pulpcore_postgresql_ssl, + postgresql_db_ssl_require => $pulpcore_postgresql_ssl_require, + postgresql_db_ssl_cert => $pulpcore_postgresql_ssl_cert, + postgresql_db_ssl_key => $pulpcore_postgresql_ssl_key, + postgresql_db_ssl_root_ca => $pulpcore_postgresql_ssl_root_ca, + worker_count => $pulpcore_worker_count, + before => Class['foreman_proxy::plugin::pulp'], } - if $pulpcore { - if $pulpcore_mirror { - $pulpcore_allowed_import_path = ['/var/lib/pulp/sync_imports'] - $pulpcore_allowed_export_path = [] - } else { - $pulpcore_allowed_import_path = ['/var/lib/pulp/sync_imports', '/var/lib/pulp/imports'] - $pulpcore_allowed_export_path = ['/var/lib/pulp/exports'] - } - 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' - $apache_https_cert = undef - $apache_https_key = undef - $apache_https_ca = undef - $apache_https_chain = undef - Class['foreman::config::apache'] -> Class['pulpcore::apache'] - } elsif $pulp and $pulp::manage_httpd { - $servername = $pulp::server_name - $priority = '05' - $apache_http_vhost = 'pulp-http' - $apache_https_vhost = 'pulp-https' - $apache_https_cert = undef - $apache_https_key = undef - $apache_https_ca = undef - $apache_https_chain = undef - Class['pulp::apache'] -> Class['pulpcore::apache'] - } else { - include certs::apache - Class['certs::apache'] ~> Class['pulpcore::apache'] - $servername = $certs::apache::hostname - $priority = undef - $apache_http_vhost = undef - $apache_https_vhost = undef - $apache_https_cert = $certs::apache::apache_cert - $apache_https_key = $certs::apache::apache_key - $apache_https_ca = $certs::katello_default_ca_cert - $apache_https_chain = $certs::katello_server_ca_cert + if $enable_docker { + include pulpcore::plugin::container + } + if $enable_file { + class { 'pulpcore::plugin::file': + use_pulp2_content_route => true, } - - class { 'pulpcore': - allowed_import_path => $pulpcore_allowed_import_path, - allowed_export_path => $pulpcore_allowed_export_path, - apache_http_vhost => $apache_http_vhost, - apache_https_vhost => $apache_https_vhost, - apache_https_cert => $apache_https_cert, - apache_https_key => $apache_https_key, - apache_https_ca => $apache_https_ca, - apache_https_chain => $apache_https_chain, - 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, - postgresql_db_user => $pulpcore_postgresql_user, - postgresql_db_password => $pulpcore_postgresql_password, - postgresql_db_name => $pulpcore_postgresql_db_name, - postgresql_db_ssl => $pulpcore_postgresql_ssl, - postgresql_db_ssl_require => $pulpcore_postgresql_ssl_require, - postgresql_db_ssl_cert => $pulpcore_postgresql_ssl_cert, - postgresql_db_ssl_key => $pulpcore_postgresql_ssl_key, - postgresql_db_ssl_root_ca => $pulpcore_postgresql_ssl_root_ca, - worker_count => $pulpcore_worker_count, - before => Class['foreman_proxy::plugin::pulp'], + } + if $enable_yum { + class { 'pulpcore::plugin::rpm': + use_pulp2_content_route => true, } - - if $pulp_master { - include pulp - class { 'pulpcore::plugin::migration': - mongo_db_name => $pulp::db_name, - mongo_db_seeds => $pulp::db_seeds, - mongo_db_username => $pulp::db_username, - mongo_db_password => $pulp::db_password, - mongo_db_replica_set => $pulp::db_replica_set, - mongo_db_ssl => $pulp::db_ssl, - mongo_db_ssl_keyfile => $pulp::db_ssl_keyfile, - mongo_db_ssl_certfile => $pulp::db_ssl_certfile, - mongo_db_verify_ssl => $pulp::db_verify_ssl, - mongo_db_ca_path => $pulp::db_ca_path, - } + } + if $enable_deb { + class { 'pulpcore::plugin::deb': + use_pulp2_content_route => true, } + } + include pulpcore::plugin::certguard # Required to be present by Katello when syncing a content proxy - if $enable_docker { - include pulpcore::plugin::container - } - if $enable_file { - class { 'pulpcore::plugin::file': - use_pulp2_content_route => $proxy_pulp_isos_to_pulpcore, - } - } - if $enable_yum { - class { 'pulpcore::plugin::rpm': - use_pulp2_content_route => $proxy_pulp_yum_to_pulpcore, - } - } - if $enable_deb { - class { 'pulpcore::plugin::deb': - use_pulp2_content_route => $proxy_pulp_deb_to_pulpcore, - } - } - include pulpcore::plugin::certguard # Required to be present by Katello when syncing a content proxy + class { 'foreman_proxy::plugin::pulp': + enabled => !$pulpcore_mirror, + pulpnode_enabled => false, + pulpcore_enabled => true, + pulpcore_mirror => $pulpcore_mirror, + pulpcore_api_url => "https://${servername}", + pulpcore_content_url => "https://${servername}${pulpcore::apache::content_path}", + require => Class['pulpcore'], } if $puppet { diff --git a/manifests/params.pp b/manifests/params.pp index 22ed1fc5..3bc35749 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -3,8 +3,6 @@ # when not specified, we expect all in one installation $parent_fqdn = $facts['networking']['fqdn'] - $pulp_admin_password = extlib::cache_data('foreman_cache_data', 'pulp_node_admin_password', extlib::random_password(32)) - $qpid_router_sasl_password = extlib::cache_data('foreman_cache_data', 'qpid_router_sasl_password', extlib::random_password(16)) $pulpcore_postgresql_password = extlib::cache_data('pulpcore_cache_data', 'db_password', extlib::random_password(32)) diff --git a/manifests/pub_dir.pp b/manifests/pub_dir.pp index e5cabfa7..1f056748 100644 --- a/manifests/pub_dir.pp +++ b/manifests/pub_dir.pp @@ -3,47 +3,15 @@ # The HTTP public direction contains files like the katello ca certificate # for download by clients # -# @param servername -# The servername to be used in the Apache vhost # @param pub_dir_options # The Directory options as Apache applies them class foreman_proxy_content::pub_dir ( - String $servername = $facts['networking']['fqdn'], String $pub_dir_options = '+FollowSymLinks +Indexes', ) { - include foreman_proxy_content - include apache - ensure_packages('katello-client-bootstrap') - if $foreman_proxy_content::shared_with_foreman_vhost { - include foreman::config::apache - - foreman::config::apache::fragment { 'pub_dir': - content => template('foreman_proxy_content/httpd_pub.erb'), - ssl_content => template('foreman_proxy_content/httpd_pub.erb'), - } - } elsif $foreman_proxy_content::pulp { - pulp::apache::fragment { 'pub_dir': - ssl_content => template('foreman_proxy_content/httpd_pub.erb'), - } - - file { "${apache::confd_dir}/pulp-vhosts80/pub_dir.conf": - ensure => file, - content => template('foreman_proxy_content/httpd_pub.erb'), - owner => 'apache', - group => 'apache', - mode => '0600', - notify => Service['httpd'], - } - } else { - apache::vhost { 'foreman_proxy_content': - servername => $servername, - port => 80, - priority => '05', - docroot => '/var/www/html', - options => ['SymLinksIfOwnerMatch'], - custom_fragment => template('foreman_proxy_content/httpd_pub.erb'), - } + pulpcore::apache::fragment{ 'pub_dir': + http_content => template('foreman_proxy_content/httpd_pub.erb'), + https_content => template('foreman_proxy_content/httpd_pub.erb'), } } diff --git a/metadata.json b/metadata.json index 5d3c3bc9..04a48251 100644 --- a/metadata.json +++ b/metadata.json @@ -38,7 +38,7 @@ }, { "name": "theforeman/pulpcore", - "version_requirement": ">= 2.2.0 < 3.0.0" + "version_requirement": ">= 3.0.0 < 4.0.0" } ], "requirements": [ diff --git a/spec/classes/foreman_proxy_content__broker_spec.rb b/spec/classes/foreman_proxy_content__broker_spec.rb deleted file mode 100644 index e955d4af..00000000 --- a/spec/classes/foreman_proxy_content__broker_spec.rb +++ /dev/null @@ -1,13 +0,0 @@ -require 'spec_helper' - -describe 'foreman_proxy_content::broker' do - on_supported_os.each do |os, facts| - context "on #{os}", if: facts[:operatingsystemmajrelease] == '7' do - let :facts do - facts - end - - it { is_expected.to compile.with_all_deps } - end - end -end diff --git a/spec/classes/foreman_proxy_content__pub_dir_spec.rb b/spec/classes/foreman_proxy_content__pub_dir_spec.rb index 76cdd00a..8a616781 100644 --- a/spec/classes/foreman_proxy_content__pub_dir_spec.rb +++ b/spec/classes/foreman_proxy_content__pub_dir_spec.rb @@ -7,17 +7,6 @@ facts end - let(:pre_condition) do - <<-PUPPET - include foreman_proxy - class { 'foreman_proxy::plugin::pulp': - enabled => false, - pulpnode_enabled => false, - pulpcore_enabled => false, - } - PUPPET - end - it { should compile.with_all_deps } it { should contain_package('katello-client-bootstrap') } end diff --git a/spec/classes/foreman_proxy_content__reverse_proxy_spec.rb b/spec/classes/foreman_proxy_content__reverse_proxy_spec.rb index 6ead12b3..7cae34ae 100644 --- a/spec/classes/foreman_proxy_content__reverse_proxy_spec.rb +++ b/spec/classes/foreman_proxy_content__reverse_proxy_spec.rb @@ -9,12 +9,6 @@ let(:pre_condition) do <<-PUPPET - include foreman_proxy - class { 'foreman_proxy::plugin::pulp': - enabled => false, - pulpnode_enabled => false, - pulpcore_enabled => false, - } include foreman_proxy_content PUPPET end @@ -37,17 +31,6 @@ class { 'foreman_proxy::plugin::pulp': describe 'with explicit parameters' do let(:params) { { url: 'https://foreman.example.com/', port: 443 } } - let(:pre_condition) do - <<-PUPPET - include foreman_proxy - class { 'foreman_proxy::plugin::pulp': - enabled => false, - pulpnode_enabled => false, - pulpcore_enabled => false, - } - PUPPET - end - it { is_expected.to compile.with_all_deps } it do is_expected.to contain_apache__vhost('katello-reverse-proxy') diff --git a/spec/classes/foreman_proxy_content_spec.rb b/spec/classes/foreman_proxy_content_spec.rb index 4c24b675..e2686d78 100644 --- a/spec/classes/foreman_proxy_content_spec.rb +++ b/spec/classes/foreman_proxy_content_spec.rb @@ -6,58 +6,11 @@ let(:facts) { facts } context 'without parameters' do - let(:pre_condition) do - <<-PUPPET - include foreman_proxy - class { 'foreman_proxy::plugin::pulp': - enabled => false, - pulpnode_enabled => false, - pulpcore_enabled => false, - } - PUPPET - end - it { is_expected.to compile.with_all_deps } it { is_expected.to contain_package('katello-debug') } it { is_expected.to contain_class('foreman_proxy_content::pub_dir') } end - context 'with pulp', if: facts[:operatingsystemmajrelease] == '7' do - let(:params) do - { - qpid_router: false - } - end - - let(:pre_condition) do - <<-PUPPET - include foreman_proxy - class { 'foreman_proxy::plugin::pulp': - enabled => false, - pulpnode_enabled => true, - pulpcore_enabled => false, - } - PUPPET - end - - it { is_expected.to compile.with_all_deps } - it { is_expected.to contain_class('pulp').with(manage_squid: true) } - it { is_expected.not_to contain_class('foreman_proxy_content::dispatch_router') } - it { is_expected.not_to contain_class('pulpcore') } - it { is_expected.to contain_class('foreman_proxy_content::pub_dir') } - - it do - is_expected.to contain_pulp__apache__fragment('gpg_key_proxy') - .with_ssl_content(%r{ProxyPass /katello/api/v2/repositories/ https://foo\.example\.com/katello/api/v2/repositories/}) - end - - it do - is_expected.to contain_class('foreman_proxy_content::reverse_proxy') - .with(path: '/') - .with(port: 8443) - end - end - context 'with pulpcore' do let(:params) do { @@ -65,18 +18,6 @@ class { 'foreman_proxy::plugin::pulp': } end - let(:pre_condition) do - <<-PUPPET - include foreman_proxy - class { 'foreman_proxy::plugin::pulp': - enabled => false, - pulpnode_enabled => false, - pulpcore_enabled => true, - pulpcore_mirror => false, - } - PUPPET - end - it { is_expected.to compile.with_all_deps } it { is_expected.to contain_class('foreman_proxy_content::pub_dir') } it do @@ -86,34 +27,6 @@ class { 'foreman_proxy::plugin::pulp': .that_comes_before('Class[foreman_proxy::plugin::pulp]') end - context 'as mirror' do - let(:pre_condition) do - <<-PUPPET - include foreman_proxy - class { 'foreman_proxy::plugin::pulp': - enabled => false, - pulpnode_enabled => false, - pulpcore_enabled => true, - pulpcore_mirror => true, - } - PUPPET - end - - it { is_expected.to compile.with_all_deps } - it { is_expected.to contain_class('foreman_proxy_content::pub_dir') } - it do - is_expected.to contain_class('pulpcore') - .with(apache_http_vhost: true) - .with(apache_https_vhost: true) - .that_comes_before('Class[foreman_proxy::plugin::pulp]') - end - it do - is_expected.to contain_class('foreman_proxy_content::reverse_proxy') - .with(path: '/') - .with(port: 8443) - end - end - context 'with external postgres' do let(:params) do super().merge( @@ -163,31 +76,31 @@ class { 'foreman_proxy::plugin::pulp': end end end + end - context 'pulp-2to3-migration', if: facts[:operatingsystemmajrelease] == '7' do - let(:pre_condition) do - <<-PUPPET - include foreman_proxy - class { 'foreman_proxy::plugin::pulp': - enabled => true, - pulpnode_enabled => false, - pulpcore_enabled => true, - pulpcore_mirror => false, - } - PUPPET - end - - it { is_expected.to compile.with_all_deps } - it { is_expected.to contain_class('pulpcore') } + context 'as mirror' do + let(:params) do + { + pulpcore_mirror: true + } + end - it do - is_expected.to contain_class('pulpcore::plugin::migration') - .with_mongo_db_name('pulp_database') - .with_mongo_db_seeds('localhost:27017') - .with_mongo_db_ssl(false) - .with_mongo_db_verify_ssl(true) - .with_mongo_db_ca_path('/etc/pki/tls/certs/ca-bundle.crt') - end + it { is_expected.to compile.with_all_deps } + it { is_expected.to contain_class('foreman_proxy_content::pub_dir') } + it do + is_expected.to contain_class('pulpcore') + .with(apache_http_vhost: true) + .with(apache_https_vhost: true) + .that_comes_before('Class[foreman_proxy::plugin::pulp]') + end + it do + is_expected.to contain_class('foreman_proxy_content::reverse_proxy') + .with(path: '/') + .with(port: 8443) + end + it do + is_expected.to contain_pulpcore__apache__fragment('gpg_key_proxy') + .with_https_content(%r{ProxyPass /katello/api/v2/repositories/ https://foo\.example\.com/katello/api/v2/repositories/}) end end @@ -205,13 +118,6 @@ class { 'puppet': server => true, server_foreman => true, } - include foreman_proxy - class { 'foreman_proxy::plugin::pulp': - enabled => false, - pulpnode_enabled => false, - pulpcore_enabled => false, - pulpcore_mirror => false, - } PUPPET end @@ -223,18 +129,6 @@ class { 'foreman_proxy::plugin::pulp': end describe 'with puppet server disabled' do - let(:pre_condition) do - <<-PUPPET - include foreman_proxy - class { 'foreman_proxy::plugin::pulp': - enabled => false, - pulpnode_enabled => false, - pulpcore_enabled => false, - pulpcore_mirror => false, - } - PUPPET - end - it { is_expected.to compile.with_all_deps } it { is_expected.not_to contain_class('certs::puppet') } end