From a718005b05cc03b3cca38aa35344ad1558b0d6ef Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Tue, 3 May 2016 22:25:17 -0400 Subject: [PATCH] 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 --- manifests/api.pp | 24 +++++++++++++++++++++++- templates/openstack-health.conf.erb | 1 + 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/manifests/api.pp b/manifests/api.pp index b20ddaa..2928bd2 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -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": diff --git a/templates/openstack-health.conf.erb b/templates/openstack-health.conf.erb index 5eca1ae..12aec86 100644 --- a/templates/openstack-health.conf.erb +++ b/templates/openstack-health.conf.erb @@ -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 =