
Create a new variable called galera_cluster_members which is a list of the hosts that make up the galera cluster. Set the default value to groups['galera_all'] which is the group used by openstack-ansible to refer to the members of the cluster. Replace all other references to groups['galera_all'] with the new variable. This allows other consumers of this role to use their own group naming scheme. Add a new task to verify that current host is a member of galera_cluster_members. Add the var galera_client_drop_config_file=true to the role dependency galera_client, this is required because the default value for that var in the galera_client role is based on membership of the galera_all group. Modify the functional testing to override galera_cluster_members, this aims to prevent the return of any hard-coded role references. Change-Id: I59af07217114a001cbebaa95a651919d53c9ec21
16 lines
674 B
Django/Jinja
16 lines
674 B
Django/Jinja
# {{ ansible_managed }}
|
|
|
|
{%- set all_calculated_max_connections = [] %}
|
|
{%- for galera_node in galera_cluster_members %}
|
|
{%- set _ = all_calculated_max_connections.append(hostvars[galera_node]['ansible_processor_vcpus'] | default(2) * 100) %}
|
|
{%- endfor %}
|
|
{%- set calculated_min_connections = all_calculated_max_connections | min %}
|
|
{%- set calculated_max_connections = galera_max_connections | default(calculated_min_connections) %}
|
|
|
|
# How long to wait for successfull mysql startup
|
|
# Startup can take a while if it requires a galera state transfer.
|
|
MYSQLD_STARTUP_TIMEOUT=1800
|
|
|
|
ulimit -n {{ calculated_max_connections }}
|
|
ulimit -Hn {{ calculated_max_connections }}
|