move to elastic-recheck web console in share
this provides the changes needed to handle the new elastic-recheck web console installed from the elastic-recheck package in the share tree. factor out bot code to elastic_recheck::bot this change moves elastic_recheck bot starting code out into a separate module, which lets us include all the elastic_recheck base module into the static site config. Change-Id: If53523754494a746c152c5d1384db5426b096fc1
This commit is contained in:
parent
092774ca70
commit
0da72c66cb
83
manifests/bot.pp
Normal file
83
manifests/bot.pp
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
# Copyright 2013 Hewlett-Packard Development Company, L.P.
|
||||||
|
# Copyright 2013 Samsung Electronics
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||||
|
# not use this file except in compliance with the License. You may obtain
|
||||||
|
# a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
# License for the specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
#
|
||||||
|
# Class to install and configure an instance of the elastic-recheck
|
||||||
|
# service.
|
||||||
|
#
|
||||||
|
class elastic_recheck::bot (
|
||||||
|
$gerrit_host,
|
||||||
|
$gerrit_ssh_private_key,
|
||||||
|
$gerrit_ssh_private_key_contents,
|
||||||
|
#not used today, will be used when elastic-recheck supports it.
|
||||||
|
$elasticsearch_url,
|
||||||
|
$recheck_bot_passwd,
|
||||||
|
$gerrit_user = 'elasticrecheck',
|
||||||
|
$recheck_bot_nick = 'openstackrecheck',
|
||||||
|
) {
|
||||||
|
include elastic_recheck
|
||||||
|
|
||||||
|
file { '/etc/elastic-recheck/elastic-recheck.conf':
|
||||||
|
ensure => present,
|
||||||
|
mode => '0640',
|
||||||
|
owner => 'recheck',
|
||||||
|
group => 'recheck',
|
||||||
|
content => template('elastic_recheck/elastic-recheck.conf.erb'),
|
||||||
|
require => Class['elastic_recheck'],
|
||||||
|
}
|
||||||
|
|
||||||
|
file { '/home/recheck':
|
||||||
|
ensure => directory,
|
||||||
|
mode => '0700',
|
||||||
|
owner => 'recheck',
|
||||||
|
group => 'recheck',
|
||||||
|
require => Class['elastic_recheck'],
|
||||||
|
}
|
||||||
|
|
||||||
|
file { '/home/recheck/.ssh':
|
||||||
|
ensure => directory,
|
||||||
|
mode => '0700',
|
||||||
|
owner => 'recheck',
|
||||||
|
group => 'recheck',
|
||||||
|
require => Class['elastic_recheck'],
|
||||||
|
}
|
||||||
|
|
||||||
|
file { $gerrit_ssh_private_key:
|
||||||
|
ensure => present,
|
||||||
|
mode => '0600',
|
||||||
|
owner => 'recheck',
|
||||||
|
group => 'recheck',
|
||||||
|
content => $gerrit_ssh_private_key_contents,
|
||||||
|
require => Class['elastic_recheck'],
|
||||||
|
}
|
||||||
|
|
||||||
|
file { '/etc/init.d/elastic-recheck':
|
||||||
|
ensure => present,
|
||||||
|
mode => '0755',
|
||||||
|
owner => 'root',
|
||||||
|
group => 'root',
|
||||||
|
source => 'puppet:///modules/elastic_recheck/elastic-recheck.init',
|
||||||
|
}
|
||||||
|
|
||||||
|
service { 'elastic-recheck':
|
||||||
|
ensure => running,
|
||||||
|
enable => true,
|
||||||
|
subscribe => File['/etc/elastic-recheck/elastic-recheck.conf'],
|
||||||
|
require => [
|
||||||
|
Class['elastic_recheck'],
|
||||||
|
File['/etc/init.d/elastic-recheck'],
|
||||||
|
File['/etc/elastic-recheck/elastic-recheck.conf'],
|
||||||
|
],
|
||||||
|
}
|
||||||
|
}
|
@ -16,14 +16,6 @@
|
|||||||
# service.
|
# service.
|
||||||
#
|
#
|
||||||
class elastic_recheck (
|
class elastic_recheck (
|
||||||
$gerrit_host,
|
|
||||||
$gerrit_ssh_private_key,
|
|
||||||
$gerrit_ssh_private_key_contents,
|
|
||||||
#not used today, will be used when elastic-recheck supports it.
|
|
||||||
$elasticsearch_url,
|
|
||||||
$recheck_bot_passwd,
|
|
||||||
$gerrit_user = 'elasticrecheck',
|
|
||||||
$recheck_bot_nick = 'openstackrecheck'
|
|
||||||
) {
|
) {
|
||||||
group { 'recheck':
|
group { 'recheck':
|
||||||
ensure => 'present',
|
ensure => 'present',
|
||||||
@ -62,6 +54,14 @@ class elastic_recheck (
|
|||||||
require => User['recheck'],
|
require => User['recheck'],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
file { '/var/lib/elastic-recheck':
|
||||||
|
ensure => directory,
|
||||||
|
mode => '0755',
|
||||||
|
owner => 'recheck',
|
||||||
|
group => 'recheck',
|
||||||
|
require => User['recheck'],
|
||||||
|
}
|
||||||
|
|
||||||
file { '/var/log/elastic-recheck':
|
file { '/var/log/elastic-recheck':
|
||||||
ensure => directory,
|
ensure => directory,
|
||||||
mode => '0755',
|
mode => '0755',
|
||||||
@ -78,15 +78,6 @@ class elastic_recheck (
|
|||||||
require => User['recheck'],
|
require => User['recheck'],
|
||||||
}
|
}
|
||||||
|
|
||||||
file { '/etc/elastic-recheck/elastic-recheck.conf':
|
|
||||||
ensure => present,
|
|
||||||
mode => '0640',
|
|
||||||
owner => 'recheck',
|
|
||||||
group => 'recheck',
|
|
||||||
content => template('elastic_recheck/elastic-recheck.conf.erb'),
|
|
||||||
require => File['/etc/elastic-recheck'],
|
|
||||||
}
|
|
||||||
|
|
||||||
file { '/etc/elastic-recheck/logging.config':
|
file { '/etc/elastic-recheck/logging.config':
|
||||||
ensure => present,
|
ensure => present,
|
||||||
mode => '0640',
|
mode => '0640',
|
||||||
@ -105,17 +96,6 @@ class elastic_recheck (
|
|||||||
require => File['/etc/elastic-recheck'],
|
require => File['/etc/elastic-recheck'],
|
||||||
}
|
}
|
||||||
|
|
||||||
# TODO(clarkb) put queries.yaml somewhere else.
|
|
||||||
file { '/etc/elastic-recheck/queries.yaml':
|
|
||||||
ensure => link,
|
|
||||||
target => '/opt/elastic-recheck/queries.yaml',
|
|
||||||
require => [
|
|
||||||
Vcsrepo['/opt/elastic-recheck'],
|
|
||||||
File['/etc/elastic-recheck'],
|
|
||||||
],
|
|
||||||
}
|
|
||||||
|
|
||||||
# Link in the queries directory for refactoring
|
|
||||||
file { '/etc/elastic-recheck/queries':
|
file { '/etc/elastic-recheck/queries':
|
||||||
ensure => link,
|
ensure => link,
|
||||||
target => '/opt/elastic-recheck/queries',
|
target => '/opt/elastic-recheck/queries',
|
||||||
@ -124,49 +104,4 @@ class elastic_recheck (
|
|||||||
File['/etc/elastic-recheck'],
|
File['/etc/elastic-recheck'],
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
file { '/home/recheck':
|
|
||||||
ensure => directory,
|
|
||||||
mode => '0700',
|
|
||||||
owner => 'recheck',
|
|
||||||
group => 'recheck',
|
|
||||||
require => User['recheck'],
|
|
||||||
}
|
|
||||||
|
|
||||||
file { '/home/recheck/.ssh':
|
|
||||||
ensure => directory,
|
|
||||||
mode => '0700',
|
|
||||||
owner => 'recheck',
|
|
||||||
group => 'recheck',
|
|
||||||
require => User['recheck'],
|
|
||||||
}
|
|
||||||
|
|
||||||
file { $gerrit_ssh_private_key:
|
|
||||||
ensure => present,
|
|
||||||
mode => '0600',
|
|
||||||
owner => 'recheck',
|
|
||||||
group => 'recheck',
|
|
||||||
content => $gerrit_ssh_private_key_contents,
|
|
||||||
require => User['recheck'],
|
|
||||||
}
|
|
||||||
|
|
||||||
file { '/etc/init.d/elastic-recheck':
|
|
||||||
ensure => present,
|
|
||||||
mode => '0755',
|
|
||||||
owner => 'root',
|
|
||||||
group => 'root',
|
|
||||||
source => 'puppet:///modules/elastic_recheck/elastic-recheck.init',
|
|
||||||
}
|
|
||||||
|
|
||||||
service { 'elastic-recheck':
|
|
||||||
ensure => running,
|
|
||||||
enable => true,
|
|
||||||
subscribe => File['/etc/elastic-recheck/elastic-recheck.conf'],
|
|
||||||
require => [
|
|
||||||
File['/etc/init.d/elastic-recheck'],
|
|
||||||
File['/etc/elastic-recheck/elastic-recheck.conf'],
|
|
||||||
File['/etc/elastic-recheck/queries.yaml'],
|
|
||||||
Exec['install_elastic-recheck'],
|
|
||||||
],
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user