Skip to content

Commit

Permalink
Add postgresql-debversion extension to katello
Browse files Browse the repository at this point in the history
  • Loading branch information
m-bucher authored and jlsherrill committed Jun 3, 2020
1 parent 2490726 commit 6b0c9b4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions manifests/application.pp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
$candlepin_events_ssl_key = $certs::candlepin::client_key
$crane_url = $katello::params::crane_url
$crane_ca_cert = $certs::katello_server_ca_cert
$postgresql_debversion_package = $katello::params::postgresql_debversion_package
$postgresql_evr_package = $katello::params::postgresql_evr_package
$manage_db = $foreman::db_manage

Expand All @@ -71,6 +72,9 @@
}

if $manage_db {
package { $postgresql_debversion_package:
ensure => installed,
}
package { $postgresql_evr_package:
ensure => installed,
}
Expand Down
2 changes: 2 additions & 0 deletions manifests/globals.pp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@
$candlepin_oauth_secret = extlib::cache_data('foreman_cache_data', 'candlepin_oauth_secret', extlib::random_password(32))

if $facts['os']['release']['major'] == '7' {
$postgresql_debversion_package = 'rh-postgresql12-postgresql-debversion'
$postgresql_evr_package = 'rh-postgresql12-postgresql-evr'
} else {
$postgresql_debversion_package = 'postgresql-debversion'
$postgresql_evr_package = 'postgresql-evr'
}
}
3 changes: 3 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
# The oauth key for Candlepin
# @param candlepin_oauth_secret
# The oauth secret for Candlepin
# @param postgresql_debversion_package
# The contextual package name for the PostgreSQL debversion extension
# @param postgresql_evr_package
# The contextual package name for the PostgreSQL EVR extension
class katello::params (
Expand All @@ -32,6 +34,7 @@
String[1] $candlepin_oauth_secret = $katello::globals::candlepin_oauth_secret,
Stdlib::Host $candlepin_host = 'localhost',
Stdlib::HTTPSUrl $candlepin_url = "https://${candlepin_host}:8443/candlepin",
String[1] $postgresql_debversion_package = $katello::globals::postgresql_debversion_package,
String[1] $postgresql_evr_package = $katello::globals::postgresql_evr_package,
) inherits katello::globals {
}
2 changes: 2 additions & 0 deletions spec/classes/application_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ class { 'katello::params':
if facts[:operatingsystemmajrelease] == '7'
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-debversion') }
it { is_expected.to create_package('rh-postgresql12-postgresql-evr') }
else
it { is_expected.to create_package('rubygem-katello') }
it { is_expected.not_to create_package('rubygem-katello').that_requires('Anchor[katello::candlepin]') }
it { is_expected.to create_package('postgresql-debversion') }
it { is_expected.to create_package('postgresql-evr') }
end

Expand Down

0 comments on commit 6b0c9b4

Please sign in to comment.