de79f06585
/var/run/hound isn't a directory, so this fails. It was supposed to just be in /var/run. Also, we don't want to run it every minute of 4am ... Change-Id: I7298a0e18a63bf8331686bd4c44e3a12b9c77176
61 lines
1.4 KiB
Puppet
61 lines
1.4 KiB
Puppet
# Class to configure hound on a node.
|
|
class openstack_project::codesearch (
|
|
$project_config_repo,
|
|
) {
|
|
|
|
class { 'project_config':
|
|
url => $project_config_repo,
|
|
}
|
|
|
|
class { 'hound':
|
|
manage_config => false,
|
|
}
|
|
|
|
include ::jeepyb
|
|
include ::logrotate
|
|
include ::pip
|
|
|
|
file { '/home/hound/config.json':
|
|
ensure => 'present',
|
|
}
|
|
|
|
file { '/usr/local/bin/resync-hound-config':
|
|
ensure => present,
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => '0755',
|
|
source => 'puppet:///modules/openstack_project/resync-hound-config.sh',
|
|
}
|
|
|
|
# Note: we could trigger this from project-config changes, but it
|
|
# does bring the service down for several minutes if something
|
|
# changes. Once a day should be enough.
|
|
cron { 'hound':
|
|
user => root,
|
|
hour => '4',
|
|
minute => '0',
|
|
command => 'flock -n /var/run/hound.sync.lock resync-hound-config 2>&1 >> /var/log/hound.sync.log',
|
|
environment => [
|
|
'PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin',
|
|
"PROJECTS_YAML=${::project_config::jeepyb_project_file}",
|
|
],
|
|
require => [
|
|
File['/usr/local/bin/resync-hound-config'],
|
|
File['/home/hound/config.json'],
|
|
],
|
|
}
|
|
|
|
logrotate::file { 'hound-sync':
|
|
log => '/var/log/hound.sync.log',
|
|
options => [
|
|
'compress',
|
|
'copytruncate',
|
|
'missingok',
|
|
'rotate 7',
|
|
'daily',
|
|
'notifempty',
|
|
],
|
|
}
|
|
|
|
}
|