Revision 37540211
Added by Eric Helms over 10 years ago
manifests/service.pp | ||
---|---|---|
# Candlepin Service
|
||
class candlepin::service {
|
||
service {"${katello::params::tomcat}":
|
||
|
||
service { $candlepin::tomcat:
|
||
ensure => running,
|
||
enable => true,
|
||
hasstatus => true,
|
||
hasrestart => true,
|
||
start => "/usr/sbin/service-wait ${katello::params::tomcat} start",
|
||
stop => "/usr/sbin/service-wait ${katello::params::tomcat} stop",
|
||
restart => "/usr/sbin/service-wait ${katello::params::tomcat} restart",
|
||
status => "/usr/sbin/service-wait ${katello::params::tomcat} status",
|
||
require => [
|
||
Class["candlepin::config"],
|
||
Class["postgres::service"],
|
||
File[$certs::params::katello_keystore],
|
||
File["/usr/share/${katello::params::tomcat}/conf/keystore"]
|
||
File["/usr/share/${candlepin::tomcat}/conf/keystore"]
|
||
]
|
||
}
|
||
|
||
exec { "cpinit":
|
||
exec { 'cpinit':
|
||
# tomcat startup is slow - try multiple times (the initialization service is idempotent)
|
||
command => "/usr/bin/wget --timeout=30 --tries=5 --retry-connrefused -qO- http://localhost:8080/candlepin/admin/init >${katello::params::configure_log_base}/cpinit.log 2>&1 && touch /var/lib/katello/cpinit_done",
|
||
require => [ Service["${katello::params::tomcat}"], File["${katello::params::configure_log_base}"] ],
|
||
creates => "/var/lib/katello/cpinit_done",
|
||
before => Class["apache2::service"],
|
||
command => "/usr/bin/wget --timeout=30 --tries=5 --retry-connrefused -qO- http://localhost:8080/candlepin/admin/init >${candlepin::log_dir}/cpinit.log 2>&1 && touch /var/lib/candlepin/cpinit_done",
|
||
require => [ Service[$candlepin::tomcat], File[$candlepin::log_dir] ],
|
||
creates => '/var/lib/candlepin/cpinit_done'
|
||
}
|
||
}
|
Also available in: Unified diff
Updates to become a parameterized class and reduce the dependencies
this module has to only the certs module.
Previously, this module for deploying Candlepin was tightly coupled
to a few different modules including the Katello module. This work
attempts to invert the relationship by parameterizing the Candlepin
class. This will allow a module like the Katello module to set certain
parameters that it would like Candlepin to use during configuration.
The only module left as a dependence is the certs module that creates
and sets up a keystore for tomcat via https.