{%- set hosts= [] -%}
{%- for host in hostvars.keys()|sort -%}
    {% do hosts.append(host) %}
{%- endfor %}
[mysqld]
binlog_format=ROW
innodb_autoinc_lock_mode=2
innodb_doublewrite=1
query_cache_size=0

wsrep_provider=/usr/lib/galera/libgalera_smm.so
wsrep_cluster_address=gcomm://{{ hosts|join(',') }}?pc.wait_prim=no
wsrep_sst_auth={{ MARIADB_CLUSTER_USER_ADMIN }}:{{ MARIADB_CLUSTER_PASSWORD_ADMIN }}

{% if vagrant_cluster|bool %}
wsrep_node_address={{ ansible_ssh_host }}
{% endif %}
