Add openstack-health api server
This commit adds the puppet config for running an openstack-health api instance. It'll use the subunit2sql trove db node as a data source. The puppet-openstack-health module is incorrectly named which is causing issues, a workaround to rename the repo is added to install_modules.sh. This is a temporary measure until the gerrit rename is completed. There is also a workaround in the apply test. Change-Id: I7e6d9664d087e7bdc21d92624991d0d5f86c0c99
This commit is contained in:
		| @@ -89,7 +89,13 @@ for MOD in ${!SOURCE_MODULES[*]} ; do | |||||||
|         echo "Remote repos of the form repo.git are not supported: ${MOD}" |         echo "Remote repos of the form repo.git are not supported: ${MOD}" | ||||||
|         exit 1 |         exit 1 | ||||||
|     fi |     fi | ||||||
|     MODULE_NAME=`echo $MOD | awk -F- '{print $NF}'` |     # NOTE(mtreinish): hack around incorrectly named openstack-health, | ||||||
|  |     # remove after the gerrit rename | ||||||
|  |     if [[ `echo $MOD | grep -c 'openstack-health'` -eq 1 ]]; then | ||||||
|  |         MODULE_NAME="openstack_health" | ||||||
|  |     else | ||||||
|  |         MODULE_NAME=`echo $MOD | awk -F- '{print $NF}'` | ||||||
|  |     fi | ||||||
|     # set up git base command to use the correct path |     # set up git base command to use the correct path | ||||||
|     GIT_CMD_BASE="git --git-dir=${MODULE_PATH}/${MODULE_NAME}/.git --work-tree ${MODULE_PATH}/${MODULE_NAME}" |     GIT_CMD_BASE="git --git-dir=${MODULE_PATH}/${MODULE_NAME}/.git --work-tree ${MODULE_PATH}/${MODULE_NAME}" | ||||||
|     # treat any occurrence of the module as a match |     # treat any occurrence of the module as a match | ||||||
| @@ -107,6 +113,7 @@ for MOD in ${!SOURCE_MODULES[*]} ; do | |||||||
|             git clone $MOD "${MODULE_PATH}/${MODULE_NAME}" |             git clone $MOD "${MODULE_PATH}/${MODULE_NAME}" | ||||||
|         fi |         fi | ||||||
|     fi |     fi | ||||||
|  |  | ||||||
|     # fetch the latest refs from the repo |     # fetch the latest refs from the repo | ||||||
|     $GIT_CMD_BASE remote update |     $GIT_CMD_BASE remote update | ||||||
|     # make sure the correct revision is installed, I have to use rev-list b/c rev-parse does not work with tags |     # make sure the correct revision is installed, I have to use rev-list b/c rev-parse does not work with tags | ||||||
|   | |||||||
| @@ -133,6 +133,18 @@ node 'grafana.openstack.org' { | |||||||
|   } |   } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | # Node-OS: trusty | ||||||
|  | node 'health.openstack.org' { | ||||||
|  |   class { 'openstack_project::server': | ||||||
|  |     iptables_public_tcp_ports => [80, 443], | ||||||
|  |     sysadmins                 => hiera('sysadmins', []), | ||||||
|  |   } | ||||||
|  |   class { 'openstack_project::openstack_health_api': | ||||||
|  |     subunit2sql_db_host => hiera('subunit2sql_db_host', 'localhost'), | ||||||
|  |   } | ||||||
|  | } | ||||||
|  |  | ||||||
|  |  | ||||||
| # Node-OS: precise | # Node-OS: precise | ||||||
| node 'jenkins.openstack.org' { | node 'jenkins.openstack.org' { | ||||||
|   $group = "jenkins" |   $group = "jenkins" | ||||||
|   | |||||||
| @@ -104,6 +104,7 @@ INTEGRATION_MODULES["$OPENSTACK_GIT_ROOT/openstack-infra/puppet-mysql_backup"]=" | |||||||
| INTEGRATION_MODULES["$OPENSTACK_GIT_ROOT/openstack-infra/puppet-nodepool"]="origin/master" | INTEGRATION_MODULES["$OPENSTACK_GIT_ROOT/openstack-infra/puppet-nodepool"]="origin/master" | ||||||
| INTEGRATION_MODULES["$OPENSTACK_GIT_ROOT/openstack-infra/puppet-odsreg"]="origin/master" | INTEGRATION_MODULES["$OPENSTACK_GIT_ROOT/openstack-infra/puppet-odsreg"]="origin/master" | ||||||
| INTEGRATION_MODULES["$OPENSTACK_GIT_ROOT/openstack-infra/puppet-openafs"]="origin/master" | INTEGRATION_MODULES["$OPENSTACK_GIT_ROOT/openstack-infra/puppet-openafs"]="origin/master" | ||||||
|  | INTEGRATION_MODULES["$OPENSTACK_GIT_ROOT/openstack-infra/puppet-openstack-health"]="origin/master" | ||||||
| INTEGRATION_MODULES["$OPENSTACK_GIT_ROOT/openstack-infra/puppet-openstackci"]="origin/master" | INTEGRATION_MODULES["$OPENSTACK_GIT_ROOT/openstack-infra/puppet-openstackci"]="origin/master" | ||||||
| INTEGRATION_MODULES["$OPENSTACK_GIT_ROOT/openstack-infra/puppet-openstackid"]="origin/master" | INTEGRATION_MODULES["$OPENSTACK_GIT_ROOT/openstack-infra/puppet-openstackid"]="origin/master" | ||||||
| INTEGRATION_MODULES["$OPENSTACK_GIT_ROOT/openstack-infra/puppet-os_client_config"]="origin/master" | INTEGRATION_MODULES["$OPENSTACK_GIT_ROOT/openstack-infra/puppet-os_client_config"]="origin/master" | ||||||
|   | |||||||
							
								
								
									
										30
									
								
								modules/openstack_project/manifests/openstack_health_api.pp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								modules/openstack_project/manifests/openstack_health_api.pp
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,30 @@ | |||||||
|  | # Copyright 2013 Hewlett-Packard Development Company, L.P. | ||||||
|  | # | ||||||
|  | # 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. | ||||||
|  | # | ||||||
|  | # openstack-health api worker glue class. | ||||||
|  | # | ||||||
|  | class openstack_project::openstack_health_api ( | ||||||
|  |   $subunit2sql_db_host = 'localhost', | ||||||
|  |   $subunit2sql_db_user = 'query', | ||||||
|  |   $subunit2sql_db_name = 'subunit2sql', | ||||||
|  |   $subunit2sql_db_pass = 'query', | ||||||
|  |   $hostname = $::fqdn, | ||||||
|  | ) { | ||||||
|  |   include 'openstack_health' | ||||||
|  |   class { 'openstack_health::api': | ||||||
|  |     db_uri     => "mysql+pymysql://${subunit2sql_db_user}:${subunit2sql_db_pass}@${subunit2sql_db_host}/${subunit2sql_db_name}", | ||||||
|  |     vhost_name => $hostname, | ||||||
|  |     vhost_port => 80, | ||||||
|  |   } | ||||||
|  | } | ||||||
| @@ -57,10 +57,13 @@ for MOD in ${!INTEGRATION_MODULES[*]}; do | |||||||
|     project_names+=" $project_scope/$repo_name" |     project_names+=" $project_scope/$repo_name" | ||||||
| done | done | ||||||
|  |  | ||||||
|  | project_names+=" openstack-infra/puppet-openstack-health" | ||||||
|  |  | ||||||
| sudo -E /usr/zuul-env/bin/zuul-cloner -m clonemap.yaml --cache-dir /opt/git \ | sudo -E /usr/zuul-env/bin/zuul-cloner -m clonemap.yaml --cache-dir /opt/git \ | ||||||
|     git://git.openstack.org \ |     git://git.openstack.org \ | ||||||
|     $project_names |     $project_names | ||||||
|  |  | ||||||
|  | sudo mv /etc/puppet/modules/openstack-health /etc/puppet/modules/openstack_health | ||||||
|  |  | ||||||
| if [[ ! -d applytest ]] ; then | if [[ ! -d applytest ]] ; then | ||||||
|     mkdir applytest |     mkdir applytest | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Matthew Treinish
					Matthew Treinish