Move elastic-recheck bot to status.o.o
Also, normalize some parameters to the status manifest to make it more readable (since they follow the same pattern). And make the ssh config for elastic-recheck bot match reviewday. Change-Id: I2417f121e7b3685aab9540504cdd4c6db1754e67
This commit is contained in:
parent
5f56371db8
commit
2bb28339cb
@ -316,13 +316,6 @@ node 'logstash.openstack.org' {
|
||||
'elasticsearch5.openstack.org:9200',
|
||||
'elasticsearch6.openstack.org:9200',
|
||||
],
|
||||
# Config for elastic-recheck
|
||||
gerrit_ssh_private_key => '/home/recheck/.ssh/id_rsa',
|
||||
gerrit_ssh_private_key_contents => hiera('elastic-recheck_gerrit_ssh_private_key'),
|
||||
recheck_bot_nick => 'openstackrecheck',
|
||||
recheck_bot_passwd => hiera('elastic-recheck_ircbot_password'),
|
||||
gerrit_host => 'review.openstack.org',
|
||||
elasticsearch_url => 'http://logstash.openstack.org/elasticsearch/',
|
||||
}
|
||||
}
|
||||
|
||||
@ -411,13 +404,17 @@ node 'static.openstack.org' {
|
||||
# A machine to serve various project status updates.
|
||||
node 'status.openstack.org' {
|
||||
class { 'openstack_project::status':
|
||||
sysadmins => hiera('sysadmins'),
|
||||
reviewday_rsa_key_contents => hiera('reviewday_rsa_key_contents'),
|
||||
reviewday_rsa_pubkey_contents => hiera('reviewday_rsa_pubkey_contents'),
|
||||
reviewday_gerrit_ssh_key => hiera('gerrit_ssh_rsa_pubkey_contents'),
|
||||
releasestatus_prvkey_contents => hiera('releasestatus_rsa_key_contents'),
|
||||
releasestatus_pubkey_contents => hiera('releasestatus_rsa_pubkey_contents'),
|
||||
releasestatus_gerrit_ssh_key => hiera('gerrit_ssh_rsa_pubkey_contents'),
|
||||
sysadmins => hiera('sysadmins'),
|
||||
gerrit_host => 'review.openstack.org',
|
||||
gerrit_ssh_host_key => hiera('gerrit_ssh_rsa_pubkey_contents'),
|
||||
reviewday_ssh_public_key => hiera('reviewday_rsa_pubkey_contents'),
|
||||
reviewday_ssh_private_key => hiera('reviewday_rsa_key_contents'),
|
||||
releasestatus_ssh_public_key => hiera('releasestatus_rsa_pubkey_contents'),
|
||||
releasestatus_ssh_private_key => hiera('releasestatus_rsa_key_contents'),
|
||||
recheck_ssh_public_key => hiera('elastic-recheck_gerrit_ssh_public_key'),
|
||||
recheck_ssh_private_key => hiera('elastic-recheck_gerrit_ssh_private_key'),
|
||||
recheck_bot_nick => 'openstackrecheck',
|
||||
recheck_bot_passwd => hiera('elastic-recheck_ircbot_password'),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,13 +18,12 @@
|
||||
#
|
||||
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,
|
||||
$gerrit_ssh_host_key = '',
|
||||
$recheck_gerrit_user = 'elasticrecheck',
|
||||
$recheck_ssh_private_key = '',
|
||||
$recheck_ssh_public_key = '',
|
||||
$recheck_bot_passwd,
|
||||
$gerrit_user = 'elasticrecheck',
|
||||
$recheck_bot_nick = 'openstackrecheck',
|
||||
$recheck_bot_nick,
|
||||
) {
|
||||
include elastic_recheck
|
||||
|
||||
@ -53,13 +52,37 @@ class elastic_recheck::bot (
|
||||
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'],
|
||||
if $recheck_ssh_private_key != '' {
|
||||
file { '/home/recheck/.ssh/id_rsa':
|
||||
owner => 'recheck',
|
||||
group => 'recheck',
|
||||
mode => '0600',
|
||||
content => $recheck_ssh_private_key,
|
||||
replace => true,
|
||||
require => File['/home/recheck/.ssh/']
|
||||
}
|
||||
}
|
||||
|
||||
if $recheck_ssh_public_key != '' {
|
||||
file { '/home/recheck/.ssh/id_rsa.pub':
|
||||
owner => 'recheck',
|
||||
group => 'recheck',
|
||||
mode => '0600',
|
||||
content => $recheck_ssh_public_key,
|
||||
replace => true,
|
||||
require => File['/home/recheck/.ssh/']
|
||||
}
|
||||
}
|
||||
|
||||
if $gerrit_ssh_host_key != '' {
|
||||
file { '/home/recheck/.ssh/known_hosts':
|
||||
owner => 'recheck',
|
||||
group => 'recheck',
|
||||
mode => '0600',
|
||||
content => "${gerrit_host} ${gerrit_ssh_host_key}",
|
||||
replace => true,
|
||||
require => File['/home/recheck/.ssh/']
|
||||
}
|
||||
}
|
||||
|
||||
file { '/etc/init.d/elastic-recheck':
|
||||
|
@ -8,7 +8,7 @@ channel_config=/etc/elastic-recheck/recheckwatchbot.yaml
|
||||
log_config=/etc/elastic-recheck/logging.config
|
||||
|
||||
[gerrit]
|
||||
user=<%= gerrit_user %>
|
||||
host=<%= gerrit_host %>
|
||||
user=<%= recheck_gerrit_user %>
|
||||
query_file=/etc/elastic-recheck/queries
|
||||
key=<%= gerrit_ssh_private_key %>
|
||||
key=/home/recheck/.ssh/id_rsa
|
||||
|
@ -15,13 +15,6 @@
|
||||
# Logstash web frontend glue class.
|
||||
#
|
||||
class openstack_project::logstash (
|
||||
$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,
|
||||
$recheck_bot_nick = 'openstackrecheck',
|
||||
$elasticsearch_nodes = [],
|
||||
$gearman_workers = [],
|
||||
$discover_nodes = ['elasticsearch.openstack.org:9200'],
|
||||
@ -48,13 +41,4 @@ class openstack_project::logstash (
|
||||
class { 'log_processor::client':
|
||||
config_file => 'puppet:///modules/openstack_project/logstash/jenkins-log-client.yaml',
|
||||
}
|
||||
|
||||
class { 'elastic_recheck::bot':
|
||||
gerrit_host => $gerrit_host,
|
||||
gerrit_ssh_private_key => $gerrit_ssh_private_key,
|
||||
gerrit_ssh_private_key_contents => $gerrit_ssh_private_key_contents,
|
||||
elasticsearch_url => $elasticsearch_url,
|
||||
recheck_bot_passwd => $recheck_bot_passwd,
|
||||
recheck_bot_nick => $recheck_bot_nick,
|
||||
}
|
||||
}
|
||||
|
@ -2,13 +2,17 @@
|
||||
#
|
||||
class openstack_project::status (
|
||||
$sysadmins = [],
|
||||
$reviewday_gerrit_ssh_key = '',
|
||||
$reviewday_rsa_pubkey_contents = '',
|
||||
$reviewday_rsa_key_contents = '',
|
||||
$releasestatus_prvkey_contents = '',
|
||||
$releasestatus_pubkey_contents = '',
|
||||
$releasestatus_gerrit_ssh_key = '',
|
||||
$er_state_dir = '/var/lib/elastic-recheck',
|
||||
$gerrit_host,
|
||||
$gerrit_ssh_host_key,
|
||||
$reviewday_ssh_public_key = '',
|
||||
$reviewday_ssh_private_key = '',
|
||||
$releasestatus_ssh_public_key = '',
|
||||
$releasestatus_ssh_private_key = '',
|
||||
$recheck_ssh_public_key,
|
||||
$recheck_ssh_private_key,
|
||||
$recheck_bot_passwd,
|
||||
$recheck_bot_nick,
|
||||
$recheck_state_dir = '/var/lib/elastic-recheck',
|
||||
) {
|
||||
|
||||
class { 'openstack_project::server':
|
||||
@ -138,11 +142,20 @@ class openstack_project::status (
|
||||
user => 'recheck',
|
||||
minute => '*/15',
|
||||
hour => '*',
|
||||
command => "elastic-recheck-graph /opt/elastic-recheck/queries -o ${er_state_dir}/graph-new.json && mv ${er_state_dir}/graph-new.json ${er_state_dir}/graph.json",
|
||||
command => "elastic-recheck-graph /opt/elastic-recheck/queries -o ${recheck_state_dir}/graph-new.json && mv ${recheck_state_dir}/graph-new.json ${recheck_state_dir}/graph.json",
|
||||
environment => 'PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin',
|
||||
require => Class['elastic_recheck']
|
||||
}
|
||||
|
||||
class { 'elastic_recheck::bot':
|
||||
gerrit_host => $gerrit_host,
|
||||
gerrit_ssh_host_key => $gerrit_ssh_host_key,
|
||||
recheck_ssh_public_key => $recheck_ssh_public_key,
|
||||
recheck_ssh_private_key => $recheck_ssh_private_key,
|
||||
recheck_bot_passwd => $recheck_bot_passwd,
|
||||
recheck_bot_nick => $recheck_bot_nick,
|
||||
}
|
||||
|
||||
###########################################################
|
||||
# Status - zuul
|
||||
|
||||
@ -205,18 +218,18 @@ class openstack_project::status (
|
||||
gerrit_url => 'review.openstack.org',
|
||||
gerrit_port => '29418',
|
||||
gerrit_user => 'reviewday',
|
||||
reviewday_gerrit_ssh_key => $reviewday_gerrit_ssh_key,
|
||||
reviewday_rsa_pubkey_contents => $reviewday_rsa_pubkey_contents,
|
||||
reviewday_rsa_key_contents => $reviewday_rsa_key_contents,
|
||||
reviewday_gerrit_ssh_key => $gerrit_ssh_host_key,
|
||||
reviewday_rsa_pubkey_contents => $reviewday_ssh_public_key,
|
||||
reviewday_rsa_key_contents => $reviewday_ssh_private_key,
|
||||
}
|
||||
|
||||
###########################################################
|
||||
# Status - releasestatus
|
||||
|
||||
class { 'releasestatus':
|
||||
releasestatus_prvkey_contents => $releasestatus_prvkey_contents,
|
||||
releasestatus_pubkey_contents => $releasestatus_pubkey_contents,
|
||||
releasestatus_gerrit_ssh_key => $releasestatus_gerrit_ssh_key,
|
||||
releasestatus_prvkey_contents => $releasestatus_ssh_private_key,
|
||||
releasestatus_pubkey_contents => $releasestatus_ssh_public_key,
|
||||
releasestatus_gerrit_ssh_key => $gerrit_ssh_host_key,
|
||||
}
|
||||
|
||||
releasestatus::site { 'releasestatus':
|
||||
|
Loading…
Reference in New Issue
Block a user