This changes how several fields using ansible_processor_vcpus are set to work around a bug in Ansible where ansible_processor_vcpus is reported as 0 on ppc64le today due to issues with /proc/cpuinfo format differences. An upstream fix has been proposed at [1]. [1] - ansible/ansible#16533 Change-Id: I49a024aa2165db6501d9e26d09d7940cb0531bd4
16 lines
712 B
Django/Jinja
16 lines
712 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'] | int > 0) | ternary (ansible_processor_vcpus, 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 }}
|