Support using external DBs in Monasca

This changes allows the user to configure a Monasca database
which may be different from the default database.

Partially-Implements: blueprint monasca-roles
Change-Id: Ia905190b8037ecb1782a758c0b65581fe9024bf6
This commit is contained in:
Doug Szumski 2018-10-22 12:24:20 +00:00
parent 195fec4d8d
commit 6cbb5cbdb4
5 changed files with 12 additions and 11 deletions

View File

@ -144,7 +144,8 @@ monasca_services:
####################
monasca_database_name: "monasca"
monasca_database_user: "{% if use_preconfigured_databases | bool and use_common_mariadb_user | bool %}{{ database_user }}{% else %}monasca{% endif %}"
monasca_database_address: "{{ database_address }}:{{ database_port }}"
monasca_database_address: "{{ database_address }}"
monasca_database_port: "{{ database_port }}"
monasca_influxdb_name: "monasca"
monasca_influxdb_address: "{{ kolla_internal_fqdn }}"

View File

@ -3,8 +3,8 @@
kolla_toolbox:
module_name: mysql_db
module_args:
login_host: "{{ database_address }}"
login_port: "{{ database_port }}"
login_host: "{{ monasca_database_address }}"
login_port: "{{ monasca_database_port }}"
login_user: "{{ database_user }}"
login_password: "{{ database_password }}"
name: "{{ monasca_database_name }}"
@ -18,8 +18,8 @@
kolla_toolbox:
module_name: mysql_user
module_args:
login_host: "{{ database_address }}"
login_port: "{{ database_port }}"
login_host: "{{ monasca_database_address }}"
login_port: "{{ monasca_database_port }}"
login_user: "{{ database_user }}"
login_password: "{{ database_password }}"
name: "{{ monasca_database_user }}"

View File

@ -6,7 +6,7 @@ region = {{ openstack_region_name }}
[database]
database = {{ monasca_database_name }}
connection = mysql+pymysql://{{ monasca_database_user }}:{{ monasca_database_password }}@{{ monasca_database_address }}/{{ monasca_database_name }}
connection = mysql+pymysql://{{ monasca_database_user }}:{{ monasca_database_password }}@{{ monasca_database_address }}:{{ monasca_database_port }}/{{ monasca_database_name }}
[influxdb]
database_name = {{ monasca_influxdb_name }}

View File

@ -11,8 +11,8 @@ notification_retry_topic = {{ monasca_alarm_notifications_retry_topic }}
periodic = {{ monasca_periodic_notifications_period }}:{{ monasca_periodic_notifications_topic }}
[mysql]
host = {{ database_address }}
port = {{ database_port }}
host = {{ monasca_database_address }}
port = {{ monasca_database_port }}
user = {{ monasca_database_user }}
passwd = {{ monasca_database_password }}
db = {{ monasca_database_name }}

View File

@ -109,7 +109,7 @@ sporadicMetricNamespaces:
database:
driverClass: org.drizzle.jdbc.DrizzleDriver
url: "jdbc:drizzle://{{ monasca_database_address }}/{{ monasca_database_name }}"
url: "jdbc:drizzle://{{ monasca_database_address }}:{{ monasca_database_port }}/{{ monasca_database_name }}"
user: "{{ monasca_database_user }}"
password: "{{ monasca_database_password }}"
properties:
@ -126,7 +126,7 @@ database:
# hibernate provider class
providerClass: com.zaxxer.hikari.hibernate.HikariConnectionProvider
databaseName: "{{ monasca_database_name }}"
serverName: "{{ database_address }}"
portNumber: "{{ database_port }}"
serverName: "{{ monasca_database_address }}"
portNumber: "{{ monasca_database_port }}"
# hibernate auto configuration parameter
autoConfig: validate