# {{ 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 }}