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 973a28ef11
commit 3d1b45ea4c
31 changed files with 37 additions and 38 deletions

View File

@ -98,7 +98,7 @@
- "cinder-rsyslog-client" - "cinder-rsyslog-client"
- "rsyslog-client" - "rsyslog-client"
vars: vars:
galera_address: "{{ internal_lb_vip_address }}" cinder_galera_address: "{{ internal_lb_vip_address }}"
glance_host: "{{ internal_lb_vip_address }}" glance_host: "{{ internal_lb_vip_address }}"
ansible_hostname: "{{ container_name }}" ansible_hostname: "{{ container_name }}"
cinder_storage_address: "{{ container_address }}" cinder_storage_address: "{{ container_address }}"

View File

@ -82,6 +82,6 @@
- "glance-rsyslog-client" - "glance-rsyslog-client"
- "rsyslog-client" - "rsyslog-client"
vars: vars:
galera_address: "{{ internal_lb_vip_address }}" glance_galera_address: "{{ internal_lb_vip_address }}"
ansible_hostname: "{{ container_name }}" ansible_hostname: "{{ container_name }}"
is_metal: "{{ properties.is_metal|default(false) }}" is_metal: "{{ properties.is_metal|default(false) }}"

View File

@ -57,7 +57,7 @@
- "heat-rsyslog-client" - "heat-rsyslog-client"
- "rsyslog-client" - "rsyslog-client"
vars: vars:
galera_address: "{{ internal_lb_vip_address }}" heat_galera_address: "{{ internal_lb_vip_address }}"
ansible_hostname: "{{ container_name }}" ansible_hostname: "{{ container_name }}"
is_metal: "{{ properties.is_metal|default(false) }}" is_metal: "{{ properties.is_metal|default(false) }}"
vars_files: vars_files:

View File

@ -57,7 +57,7 @@
- "horizon-rsyslog-client" - "horizon-rsyslog-client"
- "rsyslog-client" - "rsyslog-client"
vars: vars:
galera_address: "{{ internal_lb_vip_address }}" horizon_galera_address: "{{ internal_lb_vip_address }}"
ansible_hostname: "{{ container_name }}" ansible_hostname: "{{ container_name }}"
horizon_server_name: "{{ container_name }}" horizon_server_name: "{{ container_name }}"
is_metal: "{{ properties.is_metal|default(false) }}" is_metal: "{{ properties.is_metal|default(false) }}"

View File

@ -58,6 +58,6 @@
- "keystone-rsyslog-client" - "keystone-rsyslog-client"
- "rsyslog-client" - "rsyslog-client"
vars: vars:
galera_address: "{{ internal_lb_vip_address }}" keystone_galera_address: "{{ internal_lb_vip_address }}"
ansible_hostname: "{{ container_name }}" ansible_hostname: "{{ container_name }}"
is_metal: "{{ properties.is_metal|default(false) }}" is_metal: "{{ properties.is_metal|default(false) }}"

View File

@ -103,7 +103,7 @@
- "neutron-rsyslog-client" - "neutron-rsyslog-client"
- "rsyslog-client" - "rsyslog-client"
vars: vars:
galera_address: "{{ internal_lb_vip_address }}" neutron_galera_address: "{{ internal_lb_vip_address }}"
ansible_hostname: "{{ container_name }}" ansible_hostname: "{{ container_name }}"
is_metal: "{{ properties.is_metal|default(false) }}" is_metal: "{{ properties.is_metal|default(false) }}"
bind_prefix: "{{ provider_network_bind_prefix|default('') }}" bind_prefix: "{{ provider_network_bind_prefix|default('') }}"

View File

@ -99,7 +99,7 @@
- "nova-rsyslog-client" - "nova-rsyslog-client"
- "rsyslog-client" - "rsyslog-client"
vars: vars:
galera_address: "{{ internal_lb_vip_address }}" nova_galera_address: "{{ internal_lb_vip_address }}"
ansible_hostname: "{{ container_name }}" ansible_hostname: "{{ container_name }}"
ansible_ssh_host: "{{ container_address }}" ansible_ssh_host: "{{ container_address }}"
is_metal: "{{ properties.is_metal|default(false) }}" is_metal: "{{ properties.is_metal|default(false) }}"

View File

@ -18,4 +18,4 @@ This role will install the following:
roles: roles:
- { role: "os_cinder", tags: [ "os-cinder" ] } - { role: "os_cinder", tags: [ "os-cinder" ] }
vars: vars:
galera_address: "{{ internal_lb_vip_address }}" cinder_galera_address: "{{ internal_lb_vip_address }}"

View File

@ -17,7 +17,7 @@
mysql_db: mysql_db:
login_user: "{{ galera_root_user }}" login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}" login_password: "{{ galera_root_password }}"
login_host: "{{ galera_address }}" login_host: "{{ cinder_galera_address }}"
name: "{{ cinder_galera_database }}" name: "{{ cinder_galera_database }}"
state: "present" state: "present"
tags: tags:
@ -27,7 +27,7 @@
mysql_user: mysql_user:
login_user: "{{ galera_root_user }}" login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}" login_password: "{{ galera_root_password }}"
login_host: "{{ galera_address }}" login_host: "{{ cinder_galera_address }}"
name: "{{ cinder_galera_user }}" name: "{{ cinder_galera_user }}"
password: "{{ cinder_container_mysql_password }}" password: "{{ cinder_container_mysql_password }}"
host: "{{ item }}" host: "{{ item }}"

View File

@ -92,7 +92,7 @@ nfs_shares_config={{ cinder_nfs_client.nfs_shares_config }}
{% endif %} {% endif %}
[database] [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] [oslo_messaging_rabbit]
rabbit_port = {{ rabbitmq_port }} rabbit_port = {{ rabbitmq_port }}

View File

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

View File

@ -17,7 +17,7 @@
mysql_db: mysql_db:
login_user: "{{ galera_root_user }}" login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}" login_password: "{{ galera_root_password }}"
login_host: "{{ galera_address }}" login_host: "{{ glance_galera_address }}"
name: "{{ glance_galera_database }}" name: "{{ glance_galera_database }}"
state: "present" state: "present"
tags: tags:
@ -27,7 +27,7 @@
mysql_user: mysql_user:
login_user: "{{ galera_root_user }}" login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}" login_password: "{{ galera_root_password }}"
login_host: "{{ galera_address }}" login_host: "{{ glance_galera_address }}"
name: "{{ glance_galera_user }}" name: "{{ glance_galera_user }}"
password: "{{ glance_container_mysql_password }}" password: "{{ glance_container_mysql_password }}"
host: "{{ item }}" host: "{{ item }}"

View File

@ -48,7 +48,7 @@ image_cache_dir = {{ glance_system_user_home }}/cache/
task_executor = {{ glance_task_executor }} task_executor = {{ glance_task_executor }}
[database] [database]
connection = mysql://{{ glance_galera_user }}:{{ glance_container_mysql_password }}@{{ galera_address }}/{{ glance_galera_database }}?charset=utf8 connection = mysql://{{ glance_galera_user }}:{{ glance_container_mysql_password }}@{{ glance_galera_address }}/{{ glance_galera_database }}?charset=utf8
[keystone_authtoken] [keystone_authtoken]
auth_plugin = {{ glance_keystone_auth_plugin }} auth_plugin = {{ glance_keystone_auth_plugin }}

View File

@ -6,4 +6,4 @@ fatal_deprecations = {{ glance_fatal_deprecations }}
use_syslog = False use_syslog = False
[database] [database]
connection = mysql://{{ glance_galera_user }}:{{ glance_container_mysql_password }}@{{ galera_address }}/{{ glance_galera_database }}?charset=utf8 connection = mysql://{{ glance_galera_user }}:{{ glance_container_mysql_password }}@{{ glance_galera_address }}/{{ glance_galera_database }}?charset=utf8

View File

@ -18,7 +18,7 @@ api_limit_max = 1000
limit_param_default = 25 limit_param_default = 25
[database] [database]
connection = mysql://{{ glance_galera_user }}:{{ glance_container_mysql_password }}@{{ galera_address }}/{{ glance_galera_database }}?charset=utf8 connection = mysql://{{ glance_galera_user }}:{{ glance_container_mysql_password }}@{{ glance_galera_address }}/{{ glance_galera_database }}?charset=utf8
[keystone_authtoken] [keystone_authtoken]
auth_plugin = {{ glance_keystone_auth_plugin }} auth_plugin = {{ glance_keystone_auth_plugin }}

View File

@ -21,6 +21,6 @@ This role will install the following:
vars: vars:
external_lb_vip_address: 172.16.24.1 external_lb_vip_address: 172.16.24.1
internal_lb_vip_address: 192.168.0.1 internal_lb_vip_address: 192.168.0.1
galera_address: "{{ internal_lb_vip_address }}" heat_galera_address: "{{ internal_lb_vip_address }}"
keystone_admin_user_name: admin keystone_admin_user_name: admin
keystone_admin_tenant_name: admin keystone_admin_tenant_name: admin

View File

@ -17,7 +17,7 @@
mysql_db: mysql_db:
login_user: "{{ galera_root_user }}" login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}" login_password: "{{ galera_root_password }}"
login_host: "{{ galera_address }}" login_host: "{{ heat_galera_address }}"
name: "{{ heat_galera_database }}" name: "{{ heat_galera_database }}"
state: "present" state: "present"
tags: tags:
@ -27,7 +27,7 @@
mysql_user: mysql_user:
login_user: "{{ galera_root_user }}" login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}" login_password: "{{ galera_root_password }}"
login_host: "{{ galera_address }}" login_host: "{{ heat_galera_address }}"
name: "{{ heat_galera_user }}" name: "{{ heat_galera_user }}"
password: "{{ heat_container_mysql_password }}" password: "{{ heat_container_mysql_password }}"
host: "{{ item }}" host: "{{ item }}"

View File

@ -35,7 +35,7 @@ endpoint_type = {{ heat_clients_endpoint }}
endpoint_type = {{ heat_clients_heat_endpoint }} endpoint_type = {{ heat_clients_heat_endpoint }}
[database] [database]
connection = mysql://{{ heat_galera_user }}:{{ heat_container_mysql_password }}@{{ galera_address }}/{{ heat_galera_database }}?charset=utf8 connection = mysql://{{ heat_galera_user }}:{{ heat_container_mysql_password }}@{{ heat_galera_address }}/{{ heat_galera_database }}?charset=utf8
[ec2authtoken] [ec2authtoken]
auth_uri = {{ keystone_service_internalurl }} auth_uri = {{ keystone_service_internalurl }}

View File

@ -16,4 +16,4 @@ This role will install the following:
roles: roles:
- { role: "os_horizon", tags: [ "os-horizon" ] } - { role: "os_horizon", tags: [ "os-horizon" ] }
vars: vars:
galera_address: "{{ internal_lb_vip_address }}" horizon_galera_address: "{{ internal_lb_vip_address }}"

View File

@ -17,7 +17,7 @@
mysql_db: mysql_db:
login_user: "{{ galera_root_user }}" login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}" login_password: "{{ galera_root_password }}"
login_host: "{{ galera_address }}" login_host: "{{ horizon_galera_address }}"
name: "{{ horizon_galera_database }}" name: "{{ horizon_galera_database }}"
state: "present" state: "present"
tags: tags:
@ -27,7 +27,7 @@
mysql_user: mysql_user:
login_user: "{{ galera_root_user }}" login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}" login_password: "{{ galera_root_password }}"
login_host: "{{ galera_address }}" login_host: "{{ horizon_galera_address }}"
name: "{{ horizon_galera_user }}" name: "{{ horizon_galera_user }}"
password: "{{ horizon_container_mysql_password }}" password: "{{ horizon_container_mysql_password }}"
host: "{{ item }}" host: "{{ item }}"

View File

@ -136,7 +136,7 @@ SESSION_ENGINE = "django.contrib.sessions.backends.cached_db"
DATABASES = { DATABASES = {
'default': { 'default': {
'ENGINE': 'django.db.backends.mysql', 'ENGINE': 'django.db.backends.mysql',
'HOST': '{{ galera_address }}', 'HOST': '{{ horizon_galera_address }}',
'NAME': '{{ horizon_galera_database }}', 'NAME': '{{ horizon_galera_database }}',
'USER': '{{ horizon_galera_user }}', 'USER': '{{ horizon_galera_user }}',
'PASSWORD': '{{ horizon_container_mysql_password }}', 'PASSWORD': '{{ horizon_container_mysql_password }}',

View File

@ -19,4 +19,4 @@ This role will install the following:
vars: vars:
external_lb_vip_address: 172.16.24.1 external_lb_vip_address: 172.16.24.1
internal_lb_vip_address: 192.168.0.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: mysql_db:
login_user: "{{ galera_root_user }}" login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}" login_password: "{{ galera_root_password }}"
login_host: "{{ galera_address }}" login_host: "{{ keystone_galera_address }}"
name: "{{ keystone_galera_database }}" name: "{{ keystone_galera_database }}"
state: "present" state: "present"
tags: tags:
@ -27,7 +27,7 @@
mysql_user: mysql_user:
login_user: "{{ galera_root_user }}" login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}" login_password: "{{ galera_root_password }}"
login_host: "{{ galera_address }}" login_host: "{{ keystone_galera_address }}"
name: "{{ keystone_galera_user }}" name: "{{ keystone_galera_user }}"
password: "{{ keystone_container_mysql_password }}" password: "{{ keystone_container_mysql_password }}"
host: "{{ item }}" host: "{{ item }}"

View File

@ -47,7 +47,7 @@ methods = {{ keystone_auth_methods }}
[database] [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 }} idle_timeout = {{ keystone_database_idle_timeout }}
min_pool_size = {{ keystone_database_min_pool_size }} min_pool_size = {{ keystone_database_min_pool_size }}
max_pool_size = {{ keystone_database_max_pool_size }} max_pool_size = {{ keystone_database_max_pool_size }}

View File

@ -17,4 +17,4 @@ This role will install the following:
roles: roles:
- { role: "os_neutron", tags: [ "os-neutron" ] } - { role: "os_neutron", tags: [ "os-neutron" ] }
vars: vars:
galera_address: "{{ internal_lb_vip_address }}" neutron_galera_address: "{{ internal_lb_vip_address }}"

View File

@ -17,7 +17,7 @@
mysql_db: mysql_db:
login_user: "{{ galera_root_user }}" login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}" login_password: "{{ galera_root_password }}"
login_host: "{{ galera_address }}" login_host: "{{ neutron_galera_address }}"
name: "{{ neutron_galera_database }}" name: "{{ neutron_galera_database }}"
state: "present" state: "present"
tags: tags:
@ -27,7 +27,7 @@
mysql_user: mysql_user:
login_user: "{{ galera_root_user }}" login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}" login_password: "{{ galera_root_password }}"
login_host: "{{ galera_address }}" login_host: "{{ neutron_galera_address }}"
name: "{{ neutron_galera_user }}" name: "{{ neutron_galera_user }}"
password: "{{ neutron_container_mysql_password }}" password: "{{ neutron_container_mysql_password }}"
host: "{{ item }}" host: "{{ item }}"

View File

@ -119,7 +119,7 @@ check_revocations_for_cached = False
{% if inventory_hostname in groups['neutron_server'] %} {% if inventory_hostname in groups['neutron_server'] %}
[database] [database]
connection = mysql://{{ neutron_galera_user }}:{{ neutron_container_mysql_password }}@{{ galera_address }}/{{ neutron_galera_database }}?charset=utf8 connection = mysql://{{ neutron_galera_user }}:{{ neutron_container_mysql_password }}@{{ neutron_galera_address }}/{{ neutron_galera_database }}?charset=utf8
{% endif %} {% endif %}

View File

@ -24,4 +24,4 @@ This role will install the following:
roles: roles:
- { role: "os_nova", tags: [ "os-nova" ] } - { role: "os_nova", tags: [ "os-nova" ] }
vars: vars:
galera_address: "{{ internal_lb_vip_address }}" nova_galera_address: "{{ internal_lb_vip_address }}"

View File

@ -17,7 +17,7 @@
mysql_db: mysql_db:
login_user: "{{ galera_root_user }}" login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}" login_password: "{{ galera_root_password }}"
login_host: "{{ galera_address }}" login_host: "{{ nova_galera_address }}"
name: "{{ nova_galera_database }}" name: "{{ nova_galera_database }}"
state: "present" state: "present"
tags: tags:
@ -27,7 +27,7 @@
mysql_user: mysql_user:
login_user: "{{ galera_root_user }}" login_user: "{{ galera_root_user }}"
login_password: "{{ galera_root_password }}" login_password: "{{ galera_root_password }}"
login_host: "{{ galera_address }}" login_host: "{{ nova_galera_address }}"
name: "{{ nova_galera_user }}" name: "{{ nova_galera_user }}"
password: "{{ nova_container_mysql_password }}" password: "{{ nova_container_mysql_password }}"
host: "{{ item }}" host: "{{ item }}"

View File

@ -176,7 +176,7 @@ check_revocations_for_cached = False
{% if inventory_hostname not in groups['nova_compute'] %} {% if inventory_hostname not in groups['nova_compute'] %}
[database] [database]
connection = mysql://{{ nova_galera_user }}:{{ nova_container_mysql_password }}@{{ galera_address }}/{{ nova_galera_database }}?charset=utf8 connection = mysql://{{ nova_galera_user }}:{{ nova_container_mysql_password }}@{{ nova_galera_address }}/{{ nova_galera_database }}?charset=utf8
max_overflow = {{ nova_db_max_overflow }} max_overflow = {{ nova_db_max_overflow }}
max_pool_size = {{ nova_db_max_pool_size }} max_pool_size = {{ nova_db_max_pool_size }}
pool_timeout = {{ nova_db_pool_timeout }} pool_timeout = {{ nova_db_pool_timeout }}

View File

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