Add support for OpenStack Telemetry Alarming (Aodh)
Aodh is replacing the Ceilometer Alarming services, so we need to add support for it. For testing, please note it requires the current master version of puppet-aodh and https://review.openstack.org/250472 to support MongoDB as a backend database. Change-Id: I120a79378173036d3f2fb32abee07afc011b4941 Fixes: rhbz#1285314
This commit is contained in:
122
packstack/plugins/aodh_810.py
Normal file
122
packstack/plugins/aodh_810.py
Normal file
@@ -0,0 +1,122 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# 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.
|
||||
|
||||
"""
|
||||
Installs and configures Aodh
|
||||
"""
|
||||
|
||||
from packstack.installer import basedefs
|
||||
from packstack.installer import utils
|
||||
from packstack.installer import validators
|
||||
from packstack.installer import processors
|
||||
|
||||
from packstack.modules.documentation import update_params_usage
|
||||
from packstack.modules.shortcuts import get_mq
|
||||
from packstack.modules.ospluginutils import appendManifestFile
|
||||
from packstack.modules.ospluginutils import createFirewallResources
|
||||
from packstack.modules.ospluginutils import getManifestTemplate
|
||||
from packstack.modules.ospluginutils import generate_ssl_cert
|
||||
|
||||
# ------------- Aodh Packstack Plugin Initialization --------------
|
||||
|
||||
PLUGIN_NAME = "OS-Aodh"
|
||||
PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue')
|
||||
|
||||
|
||||
def initConfig(controller):
|
||||
aodh_params = {
|
||||
"AODH": [
|
||||
{"CONF_NAME": "CONFIG_AODH_KS_PW",
|
||||
"CMD_OPTION": "aodh-ks-passwd",
|
||||
"PROMPT": "Enter the password for the Aodh Keystone access",
|
||||
"OPTION_LIST": [],
|
||||
"VALIDATORS": [validators.validate_not_empty],
|
||||
"DEFAULT_VALUE": "PW_PLACEHOLDER",
|
||||
"PROCESSORS": [processors.process_password],
|
||||
"MASK_INPUT": True,
|
||||
"LOOSE_VALIDATION": False,
|
||||
"USE_DEFAULT": False,
|
||||
"NEED_CONFIRM": True,
|
||||
"CONDITION": False}
|
||||
]
|
||||
}
|
||||
|
||||
update_params_usage(basedefs.PACKSTACK_DOC, aodh_params)
|
||||
|
||||
def use_aodh(config):
|
||||
return (config['CONFIG_CEILOMETER_INSTALL'] == 'y' and
|
||||
config['CONFIG_AODH_INSTALL'] == 'y')
|
||||
|
||||
aodh_groups = [
|
||||
{"GROUP_NAME": "AODH",
|
||||
"DESCRIPTION": "Aodh Config parameters",
|
||||
"PRE_CONDITION": use_aodh,
|
||||
"PRE_CONDITION_MATCH": True,
|
||||
"POST_CONDITION": False,
|
||||
"POST_CONDITION_MATCH": True},
|
||||
]
|
||||
for group in aodh_groups:
|
||||
paramList = aodh_params[group["GROUP_NAME"]]
|
||||
controller.addGroup(group, paramList)
|
||||
|
||||
|
||||
def initSequences(controller):
|
||||
if (controller.CONF['CONFIG_AODH_INSTALL'] != 'y' or
|
||||
controller.CONF['CONFIG_CEILOMETER_INSTALL'] != 'y'):
|
||||
return
|
||||
|
||||
steps = [{'title': 'Adding Aodh manifest entries',
|
||||
'functions': [create_manifest]},
|
||||
{'title': 'Adding Aodh Keystone manifest entries',
|
||||
'functions': [create_keystone_manifest]}]
|
||||
controller.addSequence("Installing OpenStack Aodh", [], [],
|
||||
steps)
|
||||
|
||||
|
||||
# -------------------------- step functions --------------------------
|
||||
|
||||
def create_manifest(config, messages):
|
||||
manifestfile = "%s_aodh.pp" % config['CONFIG_CONTROLLER_HOST']
|
||||
manifestdata = getManifestTemplate(get_mq(config, "aodh"))
|
||||
manifestdata += getManifestTemplate("aodh")
|
||||
|
||||
if config['CONFIG_AMQP_ENABLE_SSL'] == 'y':
|
||||
ssl_cert_file = config['CONFIG_AODH_SSL_CERT'] = (
|
||||
'/etc/pki/tls/certs/ssl_amqp_aodh.crt'
|
||||
)
|
||||
ssl_key_file = config['CONFIG_AODH_SSL_KEY'] = (
|
||||
'/etc/pki/tls/private/ssl_amqp_aodh.key'
|
||||
)
|
||||
ssl_host = config['CONFIG_CONTROLLER_HOST']
|
||||
service = 'aodh'
|
||||
generate_ssl_cert(config, ssl_host, service, ssl_key_file,
|
||||
ssl_cert_file)
|
||||
|
||||
fw_details = dict()
|
||||
key = "aodh_api"
|
||||
fw_details.setdefault(key, {})
|
||||
fw_details[key]['host'] = "ALL"
|
||||
fw_details[key]['service_name'] = "aodh-api"
|
||||
fw_details[key]['chain'] = "INPUT"
|
||||
fw_details[key]['ports'] = ['8042']
|
||||
fw_details[key]['proto'] = "tcp"
|
||||
config['FIREWALL_AODH_RULES'] = fw_details
|
||||
manifestdata += createFirewallResources('FIREWALL_AODH_RULES')
|
||||
appendManifestFile(manifestfile, manifestdata, 'aodh')
|
||||
|
||||
|
||||
def create_keystone_manifest(config, messages):
|
||||
manifestfile = "%s_keystone.pp" % config['CONFIG_CONTROLLER_HOST']
|
||||
manifestdata = getManifestTemplate("keystone_aodh")
|
||||
appendManifestFile(manifestfile, manifestdata)
|
||||
Reference in New Issue
Block a user