Merge "Fixes an issue with AIO and galera clusters"

This commit is contained in:
Jenkins 2015-07-12 03:30:09 +00:00 committed by Gerrit Code Review
commit f41cde62a4
4 changed files with 11 additions and 4 deletions
ansible/roles/database

@ -5,9 +5,16 @@
- include: start.yml
# We use register as a test to see whether the database is active and ready to
# communicate. This run on all hosts that have a database and attempts to talk
# to the local database rather than the vip,
- include: register.yml
# This will restart the container we initially used to bootstrap the cluster to
# make it match the other containers environment-wise. This also prevents a
# change from showing up when rerunning the playbooks
- include: start.yml
# Since the last start.yml may have recreated some containers we must wait and
# check the health again to ensure the hosts are active.
- include: register.yml

@ -1,7 +1,7 @@
---
- name: Creating haproxy mysql user
mysql_user:
login_host: "{{ database_address }}"
login_host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"
login_user: "{{ database_user }}"
login_password: "{{ database_password }}"
name: "haproxy"

@ -9,5 +9,5 @@
- "{{ node_config_directory }}/mariadb/:/opt/kolla/mariadb/:ro"
container_volumes_from:
- "mariadb_data"
when: delegate_host != 'None' or
( delegate_host == 'None' and inventory_hostname != groups['database'][0])
when: delegate_host != 'None' or (groups['database'] | length) == 1 or
( delegate_host == 'None' and inventory_hostname != groups['database'][0] )

@ -8,7 +8,7 @@ query_cache_type=0
innodb_log_file_size=48M
wsrep_provider=/usr/lib64/galera/libgalera_smm.so
wsrep_cluster_address=gcomm://{% for host in groups['database'] %}{{ hostvars[host]['ansible_hostname'] }}{% if not loop.last %},{% endif %}{% endfor %}
wsrep_cluster_address=gcomm://{% if (groups['database'] | length) > 1 %}{% for host in groups['database'] %}{{ hostvars[host]['ansible_hostname'] }}{% if not loop.last %},{% endif %}{% endfor %}{% endif %}
wsrep_cluster_name="{{ database_cluster_name }}"
wsrep_node_address={{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}