On single nodes use an empty cluster address

When there is only one galera node, configure galera with an empty
cluster address. Each time the mysql service starts on this node it will
automatically create a new cluster.

Closes-Bug: #1624327
Change-Id: If653b1aacbd446a4ea5bb806a839dad40011b5b8
This commit is contained in:
Jimmy McCrory 2016-10-05 15:59:11 -07:00
parent 66601280ff
commit 21885c1f37

@ -67,7 +67,7 @@ galera_innodb_log_buffer_size: 128M
## wsrep configuration
galera_wsrep_address: "{{ ansible_host }}"
galera_wsrep_cluster_address: "{% for host in galera_cluster_members %}{{ hostvars[host]['ansible_host'] }}{% if not loop.last %},{% endif %}{% endfor %}"
galera_wsrep_cluster_address: "{% if galera_cluster_members | length > 1 %}{% for host in galera_cluster_members %}{{ hostvars[host]['ansible_host'] }}{% if not loop.last %},{% endif %}{% endfor %}{% endif %}"
galera_wsrep_node_incoming_address: "{{ galera_wsrep_address }}"
galera_wsrep_slave_threads: "{{ (ansible_processor_vcpus | int > 0) | ternary (ansible_processor_vcpus, 2) }}"
galera_wsrep_retry_autocommit: 3