Revision 4e995792
Added by Eric Helms over 10 years ago
manifests/config.pp | ||
---|---|---|
# Katello Config
|
||
class katello::config {
|
||
include katello::config::files
|
||
|
||
... | ... | |
#File["/etc/httpd/conf.d/katello.d"] ~>
|
||
#File["/etc/httpd/conf.d/katello.d/katello.conf"] ~> Exec["reload-apache"]
|
||
#File["/etc/httpd/conf.d/katello.conf"] ~> Exec["reload-apache"]
|
||
|
||
|
||
|
||
# exec {"httpd-restart":
|
||
# command => "/bin/sleep 5; /sbin/service httpd restart; /bin/sleep 10",
|
||
... | ... | |
# before => Class["katello::service"],
|
||
# require => $katello::params::deployment ? {
|
||
# 'katello' => [
|
||
# Class["candlepin::service"],
|
||
# Class["candlepin::service"],
|
||
# Class["pulp::service"],
|
||
# Class["foreman"],
|
||
# File["${katello::params::log_base}"],
|
||
# File["${katello::params::log_base}/production.log"],
|
||
# File["${katello::params::log_base}/production_sql.log"],
|
||
# File["${katello::params::log_base}"],
|
||
# File["${katello::params::log_base}/production.log"],
|
||
# File["${katello::params::log_base}/production_sql.log"],
|
||
# File["${katello::params::config_dir}/katello.yml"]
|
||
# ],
|
||
# 'headpin' => [
|
||
... | ... | |
# # }
|
||
# # default : {}
|
||
# #}
|
||
|
||
|
||
}
|
manifests/config/files.pp | ||
---|---|---|
# Config Files for Katello
|
||
class katello::config::files {
|
||
|
||
include katello::params
|
||
|
||
# this should be required by all classes that need to log there (one of these)
|
||
file {
|
||
"${katello::params::log_base}":
|
||
$katello::params::log_base:
|
||
owner => $katello::params::user,
|
||
group => $katello::params::group,
|
||
mode => 750;
|
||
mode => '0750';
|
||
# this is a symlink when called via katello-configure
|
||
"${katello::params::configure_log_base}":
|
||
$katello::params::configure_log_base:
|
||
owner => $katello::params::user,
|
||
group => $katello::params::group,
|
||
mode => 750;
|
||
mode => '0750';
|
||
}
|
||
|
||
file { '/usr/share/foreman/bundler.d/katello.rb':
|
||
ensure => file,
|
||
owner => $katello::params::user,
|
||
group => $katello::user_groups,
|
||
mode => "0644",
|
||
mode => '0644',
|
||
}
|
||
|
||
# create Rails logs in advance to get correct owners and permissions
|
||
... | ... | |
"${katello::params::log_base}/production_delayed_jobs_orch.log"]:
|
||
owner => $katello::params::user,
|
||
group => $katello::params::group,
|
||
content => "",
|
||
content => '',
|
||
replace => false,
|
||
mode => 640,
|
||
mode => '0640',
|
||
}
|
||
|
||
file {
|
||
... | ... | |
content => template("katello/${katello::params::config_dir}/katello.yml.erb"),
|
||
owner => $katello::params::user,
|
||
group => $katello::user_groups,
|
||
mode => "0644",
|
||
mode => '0644',
|
||
before => [Class['foreman::database'], Exec['foreman-rake-db:migrate']];
|
||
|
||
"/etc/sysconfig/katello":
|
||
content => template("katello/etc/sysconfig/katello.erb"),
|
||
owner => "root",
|
||
group => "root",
|
||
mode => "644";
|
||
'/etc/sysconfig/katello':
|
||
content => template('katello/etc/sysconfig/katello.erb'),
|
||
owner => 'root',
|
||
group => 'root',
|
||
mode => '0644';
|
||
|
||
"/etc/katello/client.conf":
|
||
content => template("katello/etc/katello/client.conf.erb"),
|
||
owner => "root",
|
||
group => "root",
|
||
mode => "644";
|
||
'/etc/katello/client.conf':
|
||
content => template('katello/etc/katello/client.conf.erb'),
|
||
owner => 'root',
|
||
group => 'root',
|
||
mode => '0644';
|
||
|
||
# "/etc/httpd/conf.d/katello.conf":
|
||
# content => template("katello/etc/httpd/conf.d/katello.conf.erb"),
|
manifests/init.pp | ||
---|---|---|
# $log_dir:: Location for Katello log files to be placed
|
||
#
|
||
class katello (
|
||
|
||
|
||
$user = $katello::params::user,
|
||
$group = $katello::params::group,
|
||
$user_groups = $katello::params::user_groups,
|
||
... | ... | |
$log_dir = $katello::params::log_dir
|
||
|
||
) inherits katello::params {
|
||
|
||
|
||
group { $katello::group:
|
||
ensure => "present"
|
||
ensure => 'present'
|
||
}
|
||
|
||
user { $katello::user:
|
||
... | ... | |
|
||
class{ 'katello::install': } ->
|
||
class{ 'katello::config::files': } ~>
|
||
class{ 'certs':
|
||
class{ 'certs':
|
||
log_dir => $katello::log_dir
|
||
} ~>
|
||
class{ 'candlepin':
|
||
... | ... | |
deployment_url => 'katello',
|
||
before => Exec['foreman-rake-db:seed']
|
||
} ~>
|
||
class{ 'pulp':
|
||
oauth_key => $katello::oauth_key,
|
||
oauth_secret => $katello::oauth_secret,
|
||
before => Exec['foreman-rake-db:seed']
|
||
class{ 'pulp':
|
||
oauth_key => $katello::oauth_key,
|
||
oauth_secret => $katello::oauth_secret,
|
||
before => Exec['foreman-rake-db:seed']
|
||
} ~>
|
||
class{ 'elasticsearch':
|
||
class{ 'elasticsearch':
|
||
before => Exec['foreman-rake-db:seed']
|
||
}
|
||
|
manifests/install.pp | ||
---|---|---|
# Katello Install
|
||
class katello::install {
|
||
|
||
$os = $operatingsystem ? {
|
||
"RedHat" => "RHEL",
|
||
"CentOS" => "RHEL",
|
||
default => "Fedora"
|
||
$os = $::operatingsystem ? {
|
||
'RedHat' => 'RHEL',
|
||
'CentOS' => 'RHEL',
|
||
default => 'Fedora'
|
||
}
|
||
|
||
$package = $os ? {
|
||
'RHEL' => 'ruby193-rubygem-katello',
|
||
'Fedora' => 'rubygem-katello'
|
||
}
|
||
}
|
||
|
||
package{[$package]:
|
||
ensure => installed,
|
||
... | ... | |
# },
|
||
# ensure => installed
|
||
# }
|
||
#
|
||
#
|
||
# Class["katello::install"] -> File["${katello::params::log_base}"]
|
||
# Class["katello::install"] -> File["${katello::params::config_dir}/thin.yml"]
|
||
# Class["katello::install"] -> File["${katello::params::config_dir}/katello.yml"]
|
manifests/params.pp | ||
---|---|---|
# Katello Default Params
|
||
class katello::params {
|
||
|
||
if ($operatingsystem == "RedHat" or $operatingsystem == "CentOS"){
|
||
if ($::operatingsystem == 'RedHat' or $::operatingsystem == 'CentOS'){
|
||
$scl_prefix = 'ruby193-'
|
||
$scl_root = '/opt/rh/ruby193/root'
|
||
} else {
|
||
... | ... | |
|
||
$deployment_url = '/katello'
|
||
|
||
if file_exists("/usr/sbin/tomcat") and !file_exists("/usr/sbin/tomcat6") {
|
||
$tomcat = "tomcat"
|
||
if file_exists('/usr/sbin/tomcat') and !file_exists('/usr/sbin/tomcat6') {
|
||
$tomcat = 'tomcat'
|
||
}
|
||
else {
|
||
$tomcat = "tomcat6"
|
||
$tomcat = 'tomcat6'
|
||
}
|
||
|
||
case $deployment_url {
|
||
... | ... | |
$deployment = 'headpin'
|
||
}
|
||
default : {
|
||
$deployment = 'katello'
|
||
$deployment = 'katello'
|
||
}
|
||
}
|
||
|
||
... | ... | |
|
||
# system settings
|
||
$host = ''
|
||
$user = "katello"
|
||
$group = "katello"
|
||
$user_groups = "foreman"
|
||
$config_dir = "/etc/katello"
|
||
$katello_dir = "/usr/share/katello"
|
||
$environment = "production"
|
||
$log_dir = "/var/log/katello"
|
||
$log_base = "/var/log/katello"
|
||
$configure_log_base = "$log_base/katello-install"
|
||
$db_env_log = "$configure_log_base/db_env.log"
|
||
$migrate_log = "$configure_log_base/db_migrate.log"
|
||
$seed_log = "$configure_log_base/db_seed.log"
|
||
$user = 'katello'
|
||
$group = 'katello'
|
||
$user_groups = 'foreman'
|
||
$config_dir = '/etc/katello'
|
||
$katello_dir = '/usr/share/katello'
|
||
$environment = 'production'
|
||
$log_dir = '/var/log/katello'
|
||
$log_base = '/var/log/katello'
|
||
$configure_log_base = "${log_base}/katello-install"
|
||
$db_env_log = "${configure_log_base}/db_env.log"
|
||
$migrate_log = "${configure_log_base}/db_migrate.log"
|
||
$seed_log = "${configure_log_base}/db_seed.log"
|
||
|
||
# katello upgrade settings
|
||
$katello_upgrade_scripts_dir = "/usr/share/katello/install/upgrade-scripts"
|
||
$katello_upgrade_history_file = "/var/lib/katello/upgrade-history"
|
||
$katello_upgrade_scripts_dir = '/usr/share/katello/install/upgrade-scripts'
|
||
$katello_upgrade_history_file = '/var/lib/katello/upgrade-history'
|
||
|
||
# SSL settings
|
||
$ssl_certificate_file = "/etc/candlepin/certs/candlepin-ca.crt"
|
||
$ssl_certificate_key_file = "/etc/candlepin/certs/candlepin-ca.key"
|
||
$ssl_certificate_file = '/etc/candlepin/certs/candlepin-ca.crt'
|
||
$ssl_certificate_key_file = '/etc/candlepin/certs/candlepin-ca.key'
|
||
$ssl_certificate_ca_file = $ssl_certificate_file
|
||
|
||
# sysconfig settings
|
||
$job_workers = 1
|
||
|
||
# OAUTH settings
|
||
$oauth_key = "katello"
|
||
$oauth_key = 'katello'
|
||
|
||
# we set foreman oauth key to foreman, so that katello knows where the call
|
||
# comes from and can find the rigth secret. This way only one key-secret pair
|
||
# is needed to be mainained for duplex communication.
|
||
$foreman_oauth_key = "foreman"
|
||
$foreman_oauth_key = 'foreman'
|
||
$oauth_secret = find_or_create_password('oauth_token_file')
|
||
|
||
# Subsystems settings
|
||
$candlepin_url = "https://localhost:8443/candlepin"
|
||
$pulp_url = subsystem_url("pulp/api/v2/")
|
||
$foreman_url = subsystem_url("foreman")
|
||
$candlepin_url = 'https://localhost:8443/candlepin'
|
||
$pulp_url = subsystem_url('pulp/api/v2/')
|
||
$foreman_url = subsystem_url('foreman')
|
||
|
||
# database reinitialization flag
|
||
$reset_data = 'NONE'
|
manifests/service.pp | ||
---|---|---|
# Katello Services
|
||
class katello::service {
|
||
include pulp::service
|
||
|
||
service {"katello":
|
||
ensure => running,
|
||
enable => true,
|
||
hasstatus => true,
|
||
hasrestart => true,
|
||
require => $katello::params::deployment ? {
|
||
'katello' => [Class["katello::config"],Class["candlepin::service"], Class["pulp::service"], Class["apache::config"]],
|
||
'headpin' => [Class["katello::config"],Class["candlepin::service"], Class["thumbslug::service"], Class["apache::config"]],
|
||
default => []
|
||
},
|
||
notify => Exec["reload-apache"];
|
||
}
|
||
|
||
service {"katello-jobs":
|
||
ensure => running,
|
||
enable => true,
|
||
hasstatus => true,
|
||
hasrestart => true,
|
||
require => Service["katello"]
|
||
service {'katello-jobs':
|
||
ensure => running,
|
||
enable => true,
|
||
hasstatus => true,
|
||
hasrestart => true,
|
||
}
|
||
}
|
Also available in: Unified diff
Fixing linting issues.