mysql-formula/mysql/files/server.cnf

49 lines
1.5 KiB
Text
Raw Normal View History

# DO NOT CHANGE THIS FILE!
# This config is generated by SALTSTACK
# and all change will be overrided on next salt call
{#-
===== FETCH DATA =====
-#}
2018-06-24 14:37:18 +01:00
{% from tpldir ~ "/map.jinja" import mysql with context %}
{%- from tpldir ~ "/supported_sections.yaml" import supported_sections with context -%}
{#-
===== COMBINE DATA =====
-#}
2018-06-24 14:37:18 +01:00
{%- set goodParamList = mysql.server_config.sections -%}
{%- for section_name in supported_sections -%}
2018-06-24 14:37:18 +01:00
{%- set sectdict = mysql.server_config.sections[section_name] | default({}) -%}
{%- for mparam, mvalue in salt['pillar.get']('mysql:server:'+section_name, {}).items() -%}
{%- set mparamUnderscore = mparam | replace('-','_') -%}
{%- do sectdict.update({mparamUnderscore:mvalue}) -%}
{%- endfor -%}
{%- do goodParamList.update({section_name:sectdict}) -%}
{%- endfor -%}
{#-
===== PRINT DATA =====
-#}
{%- for sname,sdata in goodParamList.items() -%}
{%- if sdata %}
[{{ sname }}]
{%- for mparam, mvalue in sdata.items()|default([])|sort -%}
2018-09-05 23:21:39 +02:00
{%- if mvalue is none %}{% continue %}{% endif -%}
{%- set indents = 40 - mparam|count %}
{% if mvalue == "noarg_present" -%}
{{ mparam }}
2016-03-29 15:04:15 +08:00
{% elif mvalue == "SETONPLEASE" %}
{{ mparam }}{{ '='|indent(indents, true) }} ON
{%- else -%}
{%- if mvalue is list -%}
{%- for value in mvalue %}
{{ mparam }}{{ '='|indent(indents, true) }} {{ value }}
{%- endfor -%}
{%- else -%}
{{ mparam }}{{ '='|indent(indents, true) }} {{ mvalue }}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{%- endfor %}
2018-06-24 14:37:18 +01:00
{{ mysql.server_config.append | default('') }}