diff --git a/manifests/application.pp b/manifests/application.pp index 79378d39..c4c62142 100644 --- a/manifests/application.pp +++ b/manifests/application.pp @@ -63,6 +63,8 @@ $candlepin_event_queue = $katello::params::candlepin_event_queue $crane_url = $katello::params::crane_url $crane_ca_cert = $certs::katello_server_ca_cert + $postgresql_evr_package = $katello::params::postgresql_evr_package + $manage_db = $foreman::db_manage # Katello database seeding needs candlepin Anchor <| title == 'katello::repo' or title == 'katello::candlepin' |> -> @@ -72,6 +74,12 @@ config_file => "${foreman::plugin_config_dir}/katello.yaml", } + if $manage_db { + package { $postgresql_evr_package: + ensure => installed, + } + } + foreman::config::apache::fragment { 'katello': ssl_content => file('katello/katello-apache-ssl.conf'), } diff --git a/manifests/globals.pp b/manifests/globals.pp index ae177c4d..17ceb33e 100644 --- a/manifests/globals.pp +++ b/manifests/globals.pp @@ -32,4 +32,10 @@ $candlepin_qpid_exchange = 'event' $candlepin_event_queue = 'katello_event_queue' + + if $facts['os']['release']['major'] == '7' { + $postgresql_evr_package = 'rh-postgresql12-postgresql-evr' + } else { + $postgresql_evr_package = 'postgresql-evr' + } } diff --git a/manifests/params.pp b/manifests/params.pp index 8905372d..607d66a5 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -22,6 +22,8 @@ # The oauth key for Candlepin # @param candlepin_oauth_secret # The oauth secret for Candlepin +# @param postgresql_evr_package +# The contextual package name for the PostgreSQL EVR extension class katello::params ( Stdlib::HTTPSUrl $pulp_url = "https://${facts['networking']['fqdn']}/pulp/api/v2/", Stdlib::HTTPSUrl $crane_url = "https://${facts['networking']['fqdn']}:5000", @@ -29,6 +31,7 @@ String[1] $candlepin_oauth_key = $katello::globals::candlepin_oauth_key, String[1] $candlepin_oauth_secret = $katello::globals::candlepin_oauth_secret, Stdlib::Host $candlepin_host = 'localhost', - Stdlib::HTTPSUrl $candlepin_url = "https://${candlepin_host}:8443/candlepin" + Stdlib::HTTPSUrl $candlepin_url = "https://${candlepin_host}:8443/candlepin", + String[1] $postgresql_evr_package = $katello::globals::postgresql_evr_package, ) inherits katello::globals { } diff --git a/spec/classes/application_spec.rb b/spec/classes/application_spec.rb index fe925e32..5ba78daf 100644 --- a/spec/classes/application_spec.rb +++ b/spec/classes/application_spec.rb @@ -18,6 +18,7 @@ class { 'katello::params': it { is_expected.to compile.with_all_deps } it { is_expected.to create_package('tfm-rubygem-katello') } it { is_expected.not_to create_package('tfm-rubygem-katello').that_requires('Anchor[katello::candlepin]') } + it { is_expected.to create_package('rh-postgresql12-postgresql-evr') } it { is_expected.to contain_class('certs::qpid') } it { is_expected.to contain_class('katello::qpid_client') }