From 178f6095089ecf54933376819c09e02e3dd18236 Mon Sep 17 00:00:00 2001 From: Steve Lewis Date: Fri, 5 Jun 2015 12:57:28 -0700 Subject: [PATCH] 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 --- README.rst | 2 +- tasks/cinder_db_setup.yml | 4 ++-- templates/cinder.conf.j2 | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 5ed16b73..3b7b241f 100644 --- a/README.rst +++ b/README.rst @@ -18,4 +18,4 @@ This role will install the following: roles: - { role: "os_cinder", tags: [ "os-cinder" ] } vars: - galera_address: "{{ internal_lb_vip_address }}" + cinder_galera_address: "{{ internal_lb_vip_address }}" diff --git a/tasks/cinder_db_setup.yml b/tasks/cinder_db_setup.yml index b33274de..635c4a77 100644 --- a/tasks/cinder_db_setup.yml +++ b/tasks/cinder_db_setup.yml @@ -17,7 +17,7 @@ mysql_db: login_user: "{{ galera_root_user }}" login_password: "{{ galera_root_password }}" - login_host: "{{ galera_address }}" + login_host: "{{ cinder_galera_address }}" name: "{{ cinder_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: "{{ cinder_galera_address }}" name: "{{ cinder_galera_user }}" password: "{{ cinder_container_mysql_password }}" host: "{{ item }}" diff --git a/templates/cinder.conf.j2 b/templates/cinder.conf.j2 index 228206ba..5a13b2b7 100644 --- a/templates/cinder.conf.j2 +++ b/templates/cinder.conf.j2 @@ -92,7 +92,7 @@ nfs_shares_config={{ cinder_nfs_client.nfs_shares_config }} {% endif %} [database] -connection = mysql://{{ cinder_galera_user }}:{{ cinder_container_mysql_password }}@{{ galera_address }}/{{ cinder_galera_database }}?charset=utf8 +connection = mysql://{{ cinder_galera_user }}:{{ cinder_container_mysql_password }}@{{ cinder_galera_address }}/{{ cinder_galera_database }}?charset=utf8 [oslo_messaging_rabbit] rabbit_port = {{ rabbitmq_port }}