Skip to content

Commit

Permalink
Add postgresql-evr extension to katello
Browse files Browse the repository at this point in the history
  • Loading branch information
ianballou committed Apr 9, 2020
1 parent a529288 commit e99ec6f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
9 changes: 9 additions & 0 deletions manifests/application.pp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@
$candlepin_event_queue = $katello::params::candlepin_event_queue
$crane_url = $katello::params::crane_url
$crane_ca_cert = $certs::katello_server_ca_cert
$scl_postgresql = $katello::params::scl_postgresql
$postgresql_evr_package = $katello::params::postgresql_evr_package
$manage_db = $katello::params::manage_db

# Katello database seeding needs candlepin
Anchor <| title == 'katello::repo' or title == 'katello::candlepin' |> ->
Expand All @@ -72,6 +75,12 @@
config_file => "${foreman::plugin_config_dir}/katello.yaml",
}

if $manage_db {
package { "${$scl_postgresql}-${postgresql_evr_package}":
ensure => installed,
}
}

foreman::config::apache::fragment { 'katello':
ssl_content => file('katello/katello-apache-ssl.conf'),
}
Expand Down
5 changes: 1 addition & 4 deletions manifests/candlepin.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
# Whether to connect using SSL
# @param db_ssl_verify
# Whether to verify the certificate of the database host
# @param manage_db
# Whether to manage the database. Set this to false when using a remote database
class katello::candlepin (
Stdlib::Host $db_host = 'localhost',
Optional[Stdlib::Port] $db_port = undef,
Expand All @@ -25,7 +23,6 @@
Optional[String] $db_password = undef,
Boolean $db_ssl = false,
Boolean $db_ssl_verify = true,
Boolean $manage_db = true,
) {
include certs
include katello::params
Expand Down Expand Up @@ -63,7 +60,7 @@
db_password => $db_password,
db_ssl => $db_ssl,
db_ssl_verify => $db_ssl_verify,
manage_db => $manage_db,
manage_db => $katello::params::manage_db,
subscribe => Class['certs', 'certs::candlepin'],
} ->
anchor { 'katello::candlepin': }
Expand Down
11 changes: 10 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# The host to run Candlepin as
# @param candlepin_url
# The URL to connect to Candlepin
# @param manage_db
# Whether to manage the database. Set this to false when using a remote database
# @param pulp_url
# The URL to connect to Pulp
# @param crane_url
Expand All @@ -22,13 +24,20 @@
# The oauth key for Candlepin
# @param candlepin_oauth_secret
# The oauth secret for Candlepin
# @param scl_postgresql
# The scl name for PostgreSQL
# @param postgresql_evr_package
# The contextual package name for the PostgreSQL EVR extension
class katello::params (
Stdlib::HTTPSUrl $pulp_url = "https://${facts['fqdn']}/pulp/api/v2/",
Stdlib::HTTPSUrl $crane_url = "https://${facts['fqdn']}:5000",
Stdlib::Host $qpid_hostname = 'localhost',
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",
Boolean $manage_db = true,
String[1] $scl_postgresql = 'rh-postgresql12',
String[1] $postgresql_evr_package = "postgresql-evr-0.0.1-2.el${$::os['release']['major']}.x86_64"
) inherits katello::globals {
}
2 changes: 2 additions & 0 deletions spec/classes/application_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'spec_helper'
require 'pry'

describe 'katello::application' do
on_os_under_test.each do |os, facts|
Expand All @@ -18,6 +19,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-0.0.1-2.el7.x86_64') }
it { is_expected.to contain_class('certs::qpid') }
it { is_expected.to contain_class('katello::qpid_client') }

Expand Down

0 comments on commit e99ec6f

Please sign in to comment.