-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This rewrites large parts of the module. The main goal is to split init.pp into several classes that each describe a part of the stack. This is then composed in init.pp where additional chaining is applied. While it doesn't add parameters to choose the composition, it does open the path to it. It also relies more on using puppet-foreman. This means $config_dir is removed in favor of $foreman::plugin_config_dir. Additionally it uses Foreman::rake as chaining rather than the internal Execs. Similarly it now notifies the tasks instead of the Service. All classes use explicit parameters in the local scope and have their own specs.
- Loading branch information
Showing
20 changed files
with
749 additions
and
373 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# Install and configure the katello application itself | ||
class katello::application ( | ||
Array[String] $package_names = $::katello::package_names, | ||
Boolean $enable_ostree = $::katello::enable_ostree, | ||
String $rubygem_katello_ostree = $::katello::rubygem_katello_ostree, | ||
Optional[Enum['SSLv23', 'TLSv1', '']] $cdn_ssl_version = $::katello::cdn_ssl_version, | ||
String $deployment_url = $::katello::deployment_url, | ||
String $post_sync_token = $::katello::post_sync_token, | ||
Stdlib::Httpsurl $candlepin_url = $::katello::candlepin_url, | ||
String $oauth_key = $::katello::oauth_key, | ||
String $oauth_secret = $::katello::oauth_secret, | ||
Stdlib::Httpsurl $pulp_url = $::katello::pulp_url, | ||
String $qpid_url = $::katello::qpid_url, | ||
String $candlepin_event_queue = $::katello::candlepin_event_queue, | ||
Optional[String] $proxy_host = $::katello::proxy_url, | ||
Optional[Integer[0, 65535]] $proxy_port = $::katello::proxy_port, | ||
Optional[String] $proxy_username = $::katello::proxy_username, | ||
Optional[String] $proxy_password = $::katello::proxy_password, | ||
) { | ||
include ::certs | ||
include ::certs::apache | ||
include ::certs::foreman | ||
include ::certs::pulp_client | ||
|
||
$candlepin_ca_cert = $::certs::ca_cert | ||
$pulp_ca_cert = $::certs::katello_server_ca_cert | ||
|
||
foreman_config_entry { 'pulp_client_cert': | ||
value => $::certs::pulp_client::client_cert, | ||
ignore_missing => false, | ||
require => [Class['certs::pulp_client'], Foreman::Rake['db:seed']], | ||
} | ||
|
||
foreman_config_entry { 'pulp_client_key': | ||
value => $::certs::pulp_client::client_key, | ||
ignore_missing => false, | ||
require => [Class['certs::pulp_client'], Foreman::Rake['db:seed']], | ||
} | ||
|
||
# We used to override permissions here so this matches it back to the packaging | ||
file { '/usr/share/foreman/bundler.d/katello.rb': | ||
ensure => file, | ||
owner => 'root', | ||
group => 'root', | ||
mode => '0644', | ||
} | ||
|
||
include ::foreman | ||
include ::foreman::plugin::tasks | ||
|
||
Class['certs', 'certs::ca', 'certs::apache'] ~> Class['apache::service'] | ||
|
||
# Katello database seeding needs candlepin | ||
package { $package_names: | ||
ensure => installed, | ||
} -> | ||
file { "${::foreman::plugin_config_dir}/katello.yaml": | ||
ensure => file, | ||
owner => 'root', | ||
group => $::foreman::group, | ||
mode => '0640', | ||
content => template('katello/katello.yaml.erb'), | ||
notify => [Class['foreman::service', 'foreman::plugin::tasks'], Foreman::Rake['db:seed']], | ||
} | ||
|
||
if $enable_ostree { | ||
package { $rubygem_katello_ostree: | ||
ensure => installed, | ||
notify => [Class['foreman::service', 'foreman::plugin::tasks'], Foreman::Rake['apipie:cache:index']], | ||
} | ||
} | ||
|
||
foreman::config::passenger::fragment{ 'katello': | ||
ssl_content => file('katello/katello-apache-ssl.conf'), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Katello configuration for candlepin | ||
class katello::candlepin ( | ||
Variant[Array[String], String] $user_groups = $::katello::user_groups, | ||
String $oauth_key = $::katello::oauth_key, | ||
String $oauth_secret = $::katello::oauth_secret, | ||
String $deployment_url = $::katello::deployment_url, | ||
String $db_host = $::katello::candlepin_db_host, | ||
Optional[Integer[0, 65535]] $db_port = $::katello::candlepin_db_port, | ||
String $db_name = $::katello::candlepin_db_name, | ||
String $db_user = $::katello::candlepin_db_user, | ||
String $db_password = $::katello::candlepin_db_password, | ||
Boolean $db_ssl = $::katello::candlepin_db_ssl, | ||
Boolean $db_ssl_verify = $::katello::candlepin_db_ssl_verify, | ||
Boolean $manage_db = $::katello::candlepin_manage_db, | ||
String $qpid_hostname = $::katello::qpid_hostname, | ||
) { | ||
include ::certs | ||
include ::certs::qpid | ||
include ::certs::candlepin | ||
include ::katello::qpid_client | ||
|
||
class { '::candlepin': | ||
user_groups => $user_groups, | ||
oauth_key => $oauth_key, | ||
oauth_secret => $oauth_secret, | ||
deployment_url => $deployment_url, | ||
ca_key => $::certs::ca_key, | ||
ca_cert => $::certs::ca_cert_stripped, | ||
keystore_password => $::certs::candlepin::keystore_password, | ||
truststore_password => $::certs::candlepin::keystore_password, | ||
enable_basic_auth => false, | ||
consumer_system_name_pattern => '.+', | ||
adapter_module => 'org.candlepin.katello.KatelloModule', | ||
amq_enable => true, | ||
amqp_keystore_password => $::certs::candlepin::keystore_password, | ||
amqp_truststore_password => $::certs::candlepin::keystore_password, | ||
amqp_keystore => $::certs::candlepin::amqp_keystore, | ||
amqp_truststore => $::certs::candlepin::amqp_truststore, | ||
qpid_hostname => $qpid_hostname, | ||
qpid_ssl_cert => $::certs::qpid::client_cert, | ||
qpid_ssl_key => $::certs::qpid::client_key, | ||
db_host => $db_host, | ||
db_port => $db_port, | ||
db_name => $db_name, | ||
db_user => $db_user, | ||
db_password => $db_password, | ||
db_ssl => $db_ssl, | ||
db_ssl_verify => $db_ssl_verify, | ||
manage_db => $manage_db, | ||
subscribe => Class['certs', 'certs::qpid', 'certs::candlepin'], | ||
} | ||
|
||
contain ::candlepin | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.