Switch /etc/logstash to /etc/subunit2sql
This commit switches the use of the /etc/logstash directory to /etc/subunit2sql. This was a leftover from when we first got the subunit workers up and running and it was largely a copy and paste of the policy for the logstash workers. Changing this should make it more clear to users and consistent with the naming of everything else. Change-Id: Ie425dcf53856edd873ff1d0185dcf8e4ae30e3f8
This commit is contained in:
parent
50c21b8c3f
commit
5025c20960
|
@ -26,8 +26,17 @@ define subunit2sql::worker (
|
|||
) {
|
||||
$suffix = "-${name}"
|
||||
|
||||
if ! defined(File['/etc/logstash']) {
|
||||
file { '/etc/logstash':
|
||||
file { '/etc/logstash/':
|
||||
ensure => absent,
|
||||
}
|
||||
|
||||
user { 'subunit':
|
||||
ensure => present,
|
||||
system => true,
|
||||
}
|
||||
|
||||
if ! defined(File['/etc/subunit2sql']) {
|
||||
file { '/etc/subunit2sql':
|
||||
ensure => directory,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
|
@ -35,24 +44,24 @@ define subunit2sql::worker (
|
|||
}
|
||||
}
|
||||
|
||||
if ! defined(File['/etc/logstash/subunit2sql.conf']) {
|
||||
file { '/etc/logstash/subunit2sql.conf':
|
||||
if ! defined(File['/etc/subunit2sql/subunit2sql.conf']) {
|
||||
file { '/etc/subunit2sql/subunit2sql.conf':
|
||||
ensure => present,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0555',
|
||||
content => template('subunit2sql/subunit2sql.conf.erb'),
|
||||
require => File['/etc/logstash'],
|
||||
require => File['/etc/subunit2sql'],
|
||||
}
|
||||
}
|
||||
|
||||
file { "/etc/logstash/jenkins-subunit-worker${suffix}.yaml":
|
||||
file { "/etc/subunit2sql/jenkins-subunit-worker${suffix}.yaml":
|
||||
ensure => present,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0555',
|
||||
source => $config_file,
|
||||
require => File['/etc/logstash'],
|
||||
require => File['/etc/subunit2sql'],
|
||||
}
|
||||
|
||||
file { "/etc/init.d/jenkins-subunit-worker${suffix}":
|
||||
|
@ -63,7 +72,7 @@ define subunit2sql::worker (
|
|||
content => template('subunit2sql/jenkins-subunit-worker.init.erb'),
|
||||
require => [
|
||||
File['/usr/local/bin/subunit-gearman-worker.py'],
|
||||
File["/etc/logstash/jenkins-subunit-worker${suffix}.yaml"],
|
||||
File["/etc/subunit2sql/jenkins-subunit-worker${suffix}.yaml"],
|
||||
],
|
||||
}
|
||||
|
||||
|
@ -71,18 +80,18 @@ define subunit2sql::worker (
|
|||
enable => true,
|
||||
hasrestart => true,
|
||||
subscribe => [
|
||||
File["/etc/logstash/jenkins-subunit-worker${suffix}.yaml"],
|
||||
File["/etc/subunit2sql/jenkins-subunit-worker${suffix}.yaml"],
|
||||
Package['subunit2sql'],
|
||||
],
|
||||
require => [
|
||||
File['/etc/logstash'],
|
||||
File['/etc/subunit2sql'],
|
||||
File["/etc/init.d/jenkins-subunit-worker${suffix}"],
|
||||
],
|
||||
}
|
||||
|
||||
include ::logrotate
|
||||
logrotate::file { "subunit-worker${suffix}-debug.log":
|
||||
log => "/var/log/logstash/subunit-worker${suffix}-debug.log",
|
||||
log => "/var/log/subunit2sql/subunit-worker${suffix}-debug.log",
|
||||
options => [
|
||||
'compress',
|
||||
'copytruncate',
|
||||
|
|
|
@ -17,9 +17,9 @@ DESC="Jenkins Subunit Worker"
|
|||
NAME=jenkins-subunit-worker<%= suffix %>
|
||||
DAEMON=/usr/local/bin/subunit-gearman-worker.py
|
||||
PIDFILE=/var/run/$NAME/$NAME.pid
|
||||
DAEMON_ARGS="-c /etc/logstash/jenkins-subunit-worker<%= suffix %>.yaml -d /var/log/logstash/subunit-worker<%= suffix %>-debug.log -p $PIDFILE"
|
||||
DAEMON_ARGS="-c /etc/subunit2sql/jenkins-subunit-worker<%= suffix %>.yaml -d /var/log/subunit2sql/subunit-worker<%= suffix %>-debug.log -p $PIDFILE"
|
||||
SCRIPTNAME=/etc/init.d/$NAME
|
||||
USER=logstash
|
||||
USER=subunit
|
||||
|
||||
# Exit if the package is not installed
|
||||
[ -x "$DAEMON" ] || exit 0
|
||||
|
|
Loading…
Reference in New Issue