Support dynamic mysql port

Change-Id: I8049db89701c9ba9a46210f80ac4f24340d79e3c
This commit is contained in:
bklei 2016-02-24 09:08:13 -07:00
parent ddc65d897e
commit b6c34684bf
8 changed files with 24 additions and 15 deletions

View File

@ -110,16 +110,17 @@ class monasca::api (
}
#Variables for the template
$admin_password = $::monasca::params::admin_password
$admin_password = $::monasca::params::admin_password
$admin_project_name = $::monasca::params::admin_project_name
$admin_name = $::monasca::params::admin_name
$auth_method = $::monasca::params::auth_method
$sql_host = $::monasca::params::sql_host
$sql_user = $::monasca::params::sql_user
$sql_password = $::monasca::params::sql_password
$monasca_api_port = $::monasca::params::port
$api_db_user = $::monasca::params::api_db_user
$api_db_password = $::monasca::params::api_db_password
$admin_name = $::monasca::params::admin_name
$auth_method = $::monasca::params::auth_method
$sql_host = $::monasca::params::sql_host
$sql_user = $::monasca::params::sql_user
$sql_password = $::monasca::params::sql_password
$sql_port = $::monasca::params::sql_port
$monasca_api_port = $::monasca::params::port
$api_db_user = $::monasca::params::api_db_user
$api_db_password = $::monasca::params::api_db_password
file { $api_cfg_file:
ensure => file,

View File

@ -8,6 +8,7 @@ class monasca::db::mysql {
$sql_host = $::monasca::params::sql_host
$sql_user = $::monasca::params::sql_user
$sql_password = $::monasca::params::sql_password
$sql_port = $::monasca::params::sql_port
$monsql = '/tmp/mon.sql'
$mysql_user_class = 'mysql_user'
$monasca_remote = 'monasca@%'

View File

@ -62,9 +62,10 @@ class monasca::notification(
include ::monasca::params
# variables for the template
$sql_host = $::monasca::params::sql_host
$sql_user = $::monasca::params::sql_user
$sql_host = $::monasca::params::sql_host
$sql_user = $::monasca::params::sql_user
$sql_password = $::monasca::params::sql_password
$sql_port = $::monasca::params::sql_port
$cfg_file = '/etc/monasca/notification.yaml'
$startup_script = '/etc/init/monasca-notification.conf'

View File

@ -53,6 +53,9 @@
# [*sql_password*]
# password for the mysql user
#
# [*sql_port*]
# port for the mysql instance
#
# [*persister_config_defaults*]
# defaults for monasca persister settings
#
@ -79,6 +82,7 @@ class monasca::params(
$sql_host = undef,
$sql_user = undef,
$sql_password = undef,
$sql_port = 3306,
$pers_db_user = 'mon_persister',
$pers_db_password = undef,
$persister_config_defaults = {

View File

@ -27,9 +27,10 @@ class monasca::thresh (
include ::monasca::params
# variables for the template
$sql_host = $::monasca::params::sql_host
$sql_user = $::monasca::params::sql_user
$sql_host = $::monasca::params::sql_host
$sql_user = $::monasca::params::sql_user
$sql_password = $::monasca::params::sql_password
$sql_port = $::monasca::params::sql_port
$thresh_fetch_url = "http://${blobmirror}/repos/monasca/monasca_thresh"
$latest_thresh_deb = "/tmp/${mon_thresh_deb}"

View File

@ -17,7 +17,7 @@ kafka:
mysql:
driverClass: com.mysql.jdbc.Driver
url: jdbc:mysql://<%= @sql_host %>:3306/mon?connectTimeout=5000&autoReconnect=true
url: jdbc:mysql://<%= @sql_host %>:<%= @sql_port %>/mon?connectTimeout=5000&autoReconnect=true
user: <%= @sql_user %>
password: <%= @sql_password %>
maxWaitForConnection: 1s

View File

@ -8,6 +8,7 @@ kafka:
mysql:
host: <%= @sql_host %>
port: <%= @sql_port %>
user: <%= @sql_user %>
passwd: <%= @sql_password %>
db: mon

View File

@ -77,7 +77,7 @@ sporadicMetricNamespaces:
database:
driverClass: com.mysql.jdbc.Driver
url: jdbc:mysql://<%= @sql_host %>:3306/mon?connectTimeout=5000&autoReconnect=true
url: jdbc:mysql://<%= @sql_host %>:<%= @sql_port %>/mon?connectTimeout=5000&autoReconnect=true
user: <%= @sql_user %>
password: <%= @sql_password %>
properties: