Configure DB addresses for each service

To enable partitioning of DB traffic by-service, each service needs to
use a custom connection string. Defaulting the service address to a
common galera_address makes things continue to work by default.

While the galera_address could be overridden on a container or host
basis this requires repeating that behavior across each infra node in
the inventory. Providing service-specific connection address variables
simplifies the management somewhat for large deployments and may reduce
error rates.

The service install playbooks now default the service-specific variables
instead of galera_address to the internal lb vip from inventory to
maintain the ease-of-use currently available.

Any value for a service-specific variable set in user_variables.yml will
override the value in the playbook's vars to provide selective
customization as needed.

Change-Id: I4c98bf906a0c1cb11ddd41277a855dce22ff646a
Closes-Bug: 1462529
This commit is contained in:
Steve Lewis 2015-06-05 12:57:28 -07:00 committed by Kevin Carter
parent 355688034f
commit 8a22f29691
3 changed files with 4 additions and 4 deletions

View File

@ -19,4 +19,4 @@ This role will install the following:
vars:
external_lb_vip_address: 172.16.24.1
internal_lb_vip_address: 192.168.0.1
galera_address: "{{ internal_lb_vip_address }}"
keystone_galera_address: "{{ internal_lb_vip_address }}"

View File

@ -17,7 +17,7 @@
mysql_db:
login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}"
login_host: "{{ galera_address }}"
login_host: "{{ keystone_galera_address }}"
name: "{{ keystone_galera_database }}"
state: "present"
tags:
@ -27,7 +27,7 @@
mysql_user:
login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}"
login_host: "{{ galera_address }}"
login_host: "{{ keystone_galera_address }}"
name: "{{ keystone_galera_user }}"
password: "{{ keystone_container_mysql_password }}"
host: "{{ item }}"

View File

@ -47,7 +47,7 @@ methods = {{ keystone_auth_methods }}
[database]
connection = mysql://{{ keystone_galera_user }}:{{ keystone_container_mysql_password }}@{{ galera_address }}/{{ keystone_galera_database }}?charset=utf8
connection = mysql://{{ keystone_galera_user }}:{{ keystone_container_mysql_password }}@{{ keystone_galera_address }}/{{ keystone_galera_database }}?charset=utf8
idle_timeout = {{ keystone_database_idle_timeout }}
min_pool_size = {{ keystone_database_min_pool_size }}
max_pool_size = {{ keystone_database_max_pool_size }}