diff --git a/docs/packstack.rst b/docs/packstack.rst index 2ebfa2626..87c72a04d 100755 --- a/docs/packstack.rst +++ b/docs/packstack.rst @@ -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 ------------------------- diff --git a/packstack/plugins/aodh_810.py b/packstack/plugins/aodh_810.py index caa863368..f29ae993f 100644 --- a/packstack/plugins/aodh_810.py +++ b/packstack/plugins/aodh_810.py @@ -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}, ] } diff --git a/packstack/puppet/modules/packstack/manifests/aodh/rabbitmq.pp b/packstack/puppet/modules/packstack/manifests/aodh/rabbitmq.pp index 5a73eea87..c028f7313 100644 --- a/packstack/puppet/modules/packstack/manifests/aodh/rabbitmq.pp +++ b/packstack/puppet/modules/packstack/manifests/aodh/rabbitmq.pp @@ -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", } } diff --git a/packstack/puppet/modules/packstack/manifests/mariadb/services.pp b/packstack/puppet/modules/packstack/manifests/mariadb/services.pp index 19fe70c4e..22c8c5bc1 100755 --- a/packstack/puppet/modules/packstack/manifests/mariadb/services.pp +++ b/packstack/puppet/modules/packstack/manifests/mariadb/services.pp @@ -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'), diff --git a/packstack/puppet/modules/packstack/manifests/mariadb/services_remote.pp b/packstack/puppet/modules/packstack/manifests/mariadb/services_remote.pp index 0b20e657e..5d48b14b2 100755 --- a/packstack/puppet/modules/packstack/manifests/mariadb/services_remote.pp +++ b/packstack/puppet/modules/packstack/manifests/mariadb/services_remote.pp @@ -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', diff --git a/releasenotes/notes/aodh-move-to-mariadb-9e36b7cfdbbd2aa5.yaml b/releasenotes/notes/aodh-move-to-mariadb-9e36b7cfdbbd2aa5.yaml new file mode 100644 index 000000000..533031caa --- /dev/null +++ b/releasenotes/notes/aodh-move-to-mariadb-9e36b7cfdbbd2aa5.yaml @@ -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.