2014-09-29 00:08:11 +09:00
|
|
|
# DO NOT CHANGE THIS FILE!
|
|
|
|
# This config is generated by SALTSTACK
|
|
|
|
# and all change will be overrided on next salt call
|
2014-12-12 10:05:39 +08:00
|
|
|
{#-
|
|
|
|
===== FETCH DATA =====
|
|
|
|
-#}
|
|
|
|
{%- from "mysql/defaults.yaml" import rawmap with context -%}
|
|
|
|
{%- from "mysql/supported_sections.yaml" import supported_sections with context -%}
|
|
|
|
{%- set datamap = salt['grains.filter_by'](rawmap, grain='os', merge=salt['pillar.get']('mysql:server:lookup')) -%}
|
|
|
|
{#-
|
|
|
|
===== COMBINE DATA =====
|
|
|
|
-#}
|
|
|
|
{%- set goodParamList = datamap.config.sections -%}
|
|
|
|
{%- for section_name in supported_sections -%}
|
|
|
|
{%- set sectdict = datamap.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 }}]
|
2015-02-17 09:44:16 +01:00
|
|
|
{%- for mparam, mvalue in sdata.items()|default([])|sort -%}
|
2014-12-12 10:05:39 +08:00
|
|
|
{%- set indents = 40 - mparam|count %}
|
|
|
|
{% if mvalue == "noarg_present" -%}
|
|
|
|
{{ mparam }}
|
|
|
|
{%- else -%}
|
2015-10-05 21:44:20 +02:00
|
|
|
{{ mparam }}{{ '='|indent(indents, true) }} {{ mvalue }}
|
2014-12-12 10:05:39 +08:00
|
|
|
{%- endif -%}
|
|
|
|
{%- endfor -%}
|
|
|
|
{%- endif -%}
|
|
|
|
{%- endfor %}
|
|
|
|
|
|
|
|
{{ datamap.config.append | default('') }}
|