Move AODH to mysql storage driver

https://review.openstack.org/#/c/373043/ has removed non-SQL drivers
so we need to move out of mongodb driver.

Change-Id: I6f1d7d7e6196c8e5c6f44518d60f84de19e1885d
This commit is contained in:
Alfredo Moralejo 2016-12-05 10:12:59 -05:00
parent 3f9ce20d7e
commit 74536ea979
6 changed files with 69 additions and 2 deletions

View File

@ -1091,6 +1091,9 @@ Aodh Config parameters
**CONFIG_AODH_KS_PW**
Password to use for Telemetry Alarming to authenticate with the Identity service.
**CONFIG_AODH_DB_PW**
Password to use for Telemetry Alarming (AODH) to access the database.
Gnocchi Config parameters
-------------------------

View File

@ -44,7 +44,20 @@ def initConfig(controller):
"LOOSE_VALIDATION": False,
"USE_DEFAULT": False,
"NEED_CONFIRM": True,
"CONDITION": False}
"CONDITION": False},
{"CMD_OPTION": "aodh-db-passwd",
"PROMPT": "Enter the password for the aodh DB access",
"OPTION_LIST": [],
"VALIDATORS": [validators.validate_not_empty],
"DEFAULT_VALUE": "PW_PLACEHOLDER",
"PROCESSORS": [processors.process_password],
"MASK_INPUT": True,
"LOOSE_VALIDATION": False,
"CONF_NAME": "CONFIG_AODH_DB_PW",
"USE_DEFAULT": False,
"NEED_CONFIRM": True,
"CONDITION": False},
]
}

View File

@ -4,6 +4,9 @@ class packstack::aodh::rabbitmq ()
$kombu_ssl_keyfile = hiera('CONFIG_AODH_SSL_KEY', undef)
$kombu_ssl_certfile = hiera('CONFIG_AODH_SSL_CERT', undef)
$aodh_db_pw = hiera('CONFIG_AODH_DB_PW')
$aodh_mariadb_host = hiera('CONFIG_MARIADB_HOST_URL')
if $kombu_ssl_keyfile {
$files_to_set_owner = [ $kombu_ssl_keyfile, $kombu_ssl_certfile ]
file { $files_to_set_owner:
@ -26,6 +29,6 @@ class packstack::aodh::rabbitmq ()
kombu_ssl_ca_certs => $kombu_ssl_ca_certs,
kombu_ssl_keyfile => $kombu_ssl_keyfile,
kombu_ssl_certfile => $kombu_ssl_certfile,
database_connection => "mongodb://${config_mongodb_host}:27017/aodh",
database_connection => "mysql+pymysql://aodh:${aodh_db_pw}@${aodh_mariadb_host}/aodh",
}
}

View File

@ -34,6 +34,15 @@ class packstack::mariadb::services ()
}
}
if hiera('CONFIG_AODH_INSTALL') == 'y' and
hiera('CONFIG_CEILOMETER_INSTALL') == 'y' {
class { '::aodh::db::mysql':
password => hiera('CONFIG_AODH_DB_PW'),
host => '%',
allowed_hosts => '%',
}
}
if hiera('CONFIG_HEAT_INSTALL') == 'y' {
class { '::heat::db::mysql':
password => hiera('CONFIG_HEAT_DB_PW'),

View File

@ -121,6 +121,37 @@ class packstack::mariadb::services_remote () {
}
}
if hiera('CONFIG_AODH_INSTALL') == 'y' {
remote_database { 'aodh':
ensure => 'present',
charset => 'utf8',
db_host => hiera('CONFIG_MARIADB_HOST'),
db_user => hiera('CONFIG_MARIADB_USER'),
db_password => hiera('CONFIG_MARIADB_PW'),
provider => 'mysql',
}
$aodh_cfg_db_pw = hiera('CONFIG_AODH_DB_PW')
remote_database_user { 'aodh@%':
password_hash => mysql_password($aodh_cfg_db_pw),
db_host => hiera('CONFIG_MARIADB_HOST'),
db_user => hiera('CONFIG_MARIADB_USER'),
db_password => hiera('CONFIG_MARIADB_PW'),
provider => 'mysql',
require => Remote_database['aodh'],
}
remote_database_grant { 'aodh@%/aodh':
privileges => 'all',
db_host => hiera('CONFIG_MARIADB_HOST'),
db_user => hiera('CONFIG_MARIADB_USER'),
db_password => hiera('CONFIG_MARIADB_PW'),
provider => 'mysql',
require => Remote_database_user['aodh@%'],
}
}
if hiera('CONFIG_HEAT_INSTALL') == 'y' {
remote_database { 'heat':
ensure => 'present',

View File

@ -0,0 +1,8 @@
---
features:
- Aodh project has removed support for non-SQL drivers
in https://review.openstack.org/#/c/373043/.
Packstack has switched aodh storage backend from
MongoDB to mysqld. A new parameter CONFIG_AODH_DB_PW
has been added to configure the password of the
aodh user in the database.