Add elastic recheck to api server

This commits adds the installation of elastic-recheck and the
configuration to the openstack-health api server for using the
additional data source. This depends on openstack-health change:
Icf203668690419c38f6d6be6b6fe4af8462845f3 to work, however it's not a
hard dependency because we can land this first without any issues.
If we do it'll mean the api server will be configured and start using
the data as soon as the openstack-health change lands.

Change-Id: Ia17effc714d176f0b0ceb517bd93d6533e16fdbc
This commit is contained in:
Matthew Treinish 2016-05-03 22:25:17 -04:00
parent e6d4474cec
commit a718005b05
No known key found for this signature in database
GPG Key ID: FD12A0F214C9E177
2 changed files with 24 additions and 1 deletions

View File

@ -15,6 +15,7 @@ class openstack_health::api(
$vhost_name = 'localhost',
$vhost_port = 5000,
$ignored_run_metadata_keys = undef,
$elastic_recheck_dir = '/opt/elastic-recheck',
) {
include ::httpd::mod::wsgi
@ -46,6 +47,16 @@ class openstack_health::api(
version => 'system',
}
vcsrepo { $elastic_recheck_dir :
ensure => latest,
owner => 'openstack_health',
group => 'openstack_health',
provider => git,
revision => 'master',
source => 'https://git.openstack.org/openstack-infra/elastic-recheck',
require => Class['::openstack_health::user'],
}
::python::virtualenv { $virtualenv_dir:
ensure => present,
require => Class['::python'],
@ -75,6 +86,14 @@ class openstack_health::api(
timeout => 1800,
}
exec { 'elastic-recheck-install':
command => "${virtualenv_dir}/bin/pip install -U ${elastic_recheck_dir}",
require => Python::Virtualenv[$virtualenv_dir],
subscribe => Vcsrepo[$elastic_recheck_dir],
refreshonly => true,
timeout => 1800,
}
exec { 'package-application':
command => "${virtualenv_dir}/bin/pip install -e ${source_dir}",
refreshonly => true,
@ -87,7 +106,10 @@ class openstack_health::api(
owner => 'openstack_health',
group => 'openstack_health',
mode => '0644',
subscribe => Vcsrepo[$source_dir],
subscribe => [
Vcsrepo[$source_dir],
Vcsrepo[$elastic_recheck_dir],
],
}
::httpd::vhost { "${vhost_name}-api":

View File

@ -1,4 +1,5 @@
[default]
query_dir = <%= @elastic_recheck_dir %>/queries
db_uri = <%= scope.lookupvar("openstack_health::api::db_uri") %>
<% if @ignored_keys.length > 0 -%>
ignored_run_metadata_keys =