aboutsummaryrefslogtreecommitdiff
path: root/ansible/roles
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-07-29 11:59:01 +0000
committerGerrit Code Review <review@openstack.org>2016-07-29 11:59:01 +0000
commitd1f61dfa04161c13ef2cb5abf46997a0363fd2d8 (patch)
tree8b43190e046f511a1de7a8f68795692e8828e7c1 /ansible/roles
parent6ffab8e65fb2087746b3ac35b7eea33a243816cd (diff)
parent5838bd0b3c12eed1514e59852564006f044f241b (diff)
downloadkolla-d1f61dfa04161c13ef2cb5abf46997a0363fd2d8.tar.gz
kolla-d1f61dfa04161c13ef2cb5abf46997a0363fd2d8.zip
Merge "Enable kolla k8s to override bind api bind address in genconfig"
Diffstat (limited to 'ansible/roles')
-rw-r--r--ansible/roles/mariadb/templates/galera.cnf.j215
-rw-r--r--ansible/roles/mariadb/templates/wsrep-notify.sh.j22
2 files changed, 11 insertions, 6 deletions
diff --git a/ansible/roles/mariadb/templates/galera.cnf.j2 b/ansible/roles/mariadb/templates/galera.cnf.j2
index 7ffcb26a0..3dcb5f867 100644
--- a/ansible/roles/mariadb/templates/galera.cnf.j2
+++ b/ansible/roles/mariadb/templates/galera.cnf.j2
@@ -1,6 +1,11 @@
-{% set wsrep_driver = '/usr/lib/galera/libgalera_smm.so' if kolla_base_distro == 'ubuntu' else '/usr/lib64/galera/libgalera_smm.so' %}
+{%- set wsrep_driver = '/usr/lib/galera/libgalera_smm.so' if kolla_base_distro == 'ubuntu' else '/usr/lib64/galera/libgalera_smm.so' %}
+
+{#- Disable Galera in the case of of Kubernetes as its not supported yet. Otherwise, #}
+{#- mariadb will fail to start #}
+{%- set wsrep_driver = 'none' if orchestration_engine == 'KUBERNETES' else wsrep_driver %}
+
[mysqld]
-bind-address={{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}
+bind-address={{ api_interface_address }}
port={{ mariadb_port }}
log-error=/var/log/kolla/mariadb/mariadb.log
@@ -13,10 +18,10 @@ datadir=/var/lib/mysql/
wsrep_cluster_address=gcomm://{% if (groups['mariadb'] | length) > 1 %}{% for host in groups['mariadb'] %}{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ mariadb_wsrep_port }}{% if not loop.last %},{% endif %}{% endfor %}{% endif %}
-wsrep_provider_options=gmcast.listen_addr=tcp://{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ mariadb_wsrep_port }};ist.recv_addr={{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ mariadb_ist_port }}
+wsrep_provider_options=gmcast.listen_addr=tcp://{{ api_interface_address }}:{{ mariadb_wsrep_port }};ist.recv_addr={{ api_interface_address }}:{{ mariadb_ist_port }}
-wsrep_node_address={{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ mariadb_wsrep_port }}
-wsrep_sst_receive_address={{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ mariadb_sst_port }}
+wsrep_node_address={{ api_interface_address }}:{{ mariadb_wsrep_port }}
+wsrep_sst_receive_address={{ api_interface_address }}:{{ mariadb_sst_port }}
wsrep_provider={{ wsrep_driver }}
wsrep_cluster_name="{{ database_cluster_name }}"
diff --git a/ansible/roles/mariadb/templates/wsrep-notify.sh.j2 b/ansible/roles/mariadb/templates/wsrep-notify.sh.j2
index babd29e86..73acde3fe 100644
--- a/ansible/roles/mariadb/templates/wsrep-notify.sh.j2
+++ b/ansible/roles/mariadb/templates/wsrep-notify.sh.j2
@@ -3,7 +3,7 @@
# Edit parameters below to specify the address and login to server.
USER={{ database_user }}
PSWD={{ database_password }}
-HOST={{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}
+HOST={{ api_interface_address }}
PORT={{ mariadb_port }}
LB_USER=haproxy