Skip to content
Snippets Groups Projects
Commit 2b55567b authored by Marius B. Kotsbak's avatar Marius B. Kotsbak
Browse files

Use tpldir for template files too

Using tpldir sent to templates through context.
parent 25375839
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,8 @@ mysql_server_config:
- template: jinja
- source: salt://{{ tpldir }}/files/server.cnf
{% if os_family in ['Debian', 'Gentoo', 'RedHat'] %}
- context:
tpldir: {{ tpldir }}
- user: root
- group: root
- mode: 644
......@@ -33,6 +35,8 @@ mysql_galera_config:
- template: jinja
- source: salt://{{ tpldir }}/files/galera.cnf
{% if os_family in ['Debian', 'Gentoo', 'RedHat'] %}
- context:
tpldir: {{ tpldir }}
- user: root
- group: root
- mode: 644
......@@ -46,6 +50,8 @@ mysql_library_config:
- template: jinja
- source: salt://{{ tpldir }}/files/client.cnf
{% if os_family in ['Debian', 'Gentoo', 'RedHat'] %}
- context:
tpldir: {{ tpldir }}
- user: root
- group: root
- mode: 644
......@@ -59,6 +65,8 @@ mysql_clients_config:
- template: jinja
- source: salt://{{ tpldir }}/files/mysql-clients.cnf
{% if os_family in ['Debian', 'Gentoo', 'RedHat'] %}
- context:
tpldir: {{ tpldir }}
- user: root
- group: root
- mode: 644
......@@ -76,6 +84,8 @@ mysql_config:
{% else %}
- source: salt://{{ tpldir }}/files/my.cnf
{% endif %}
- context:
tpldir: {{ tpldir }}
{% if os_family in ['Debian', 'Gentoo', 'RedHat'] %}
- user: root
- group: root
......
......@@ -4,8 +4,8 @@
{#-
===== FETCH DATA =====
-#}
{%- from "mysql/defaults.yaml" import rawmap with context -%}
{%- from "mysql/supported_sections.yaml" import supported_sections with context -%}
{%- from tpldir ~ "/defaults.yaml" import rawmap with context -%}
{%- from tpldir ~ "/supported_sections.yaml" import supported_sections with context -%}
{%- set datamap = salt['grains.filter_by'](rawmap, grain='os', merge=salt['pillar.get']('mysql:library:lookup')) -%}
{#-
===== COMBINE DATA =====
......
......@@ -4,8 +4,8 @@
{#-
===== FETCH DATA =====
-#}
{%- from "mysql/defaults.yaml" import rawmap with context -%}
{%- from "mysql/supported_sections.yaml" import supported_sections with context -%}
{%- from tpldir ~ "/defaults.yaml" import rawmap with context -%}
{%- from tpldir ~ "/supported_sections.yaml" import supported_sections with context -%}
{%- set datamap = salt['grains.filter_by'](rawmap, grain='os', merge=salt['pillar.get']('mysql:galera:lookup')) -%}
{#-
===== COMBINE DATA =====
......
......@@ -4,8 +4,8 @@
{#-
===== FETCH DATA =====
-#}
{%- from "mysql/defaults.yaml" import rawmap with context -%}
{%- from "mysql/supported_sections.yaml" import supported_sections with context -%}
{%- from tpldir ~ "/defaults.yaml" import rawmap with context -%}
{%- from tpldir ~ "/supported_sections.yaml" import supported_sections with context -%}
{%- set datamap = salt['grains.filter_by'](rawmap, grain='os', merge=salt['pillar.get']('mysql:global:lookup')) -%}
{#-
===== COMBINE DATA =====
......
......@@ -4,8 +4,8 @@
{#-
===== FETCH DATA =====
-#}
{%- from "mysql/defaults.yaml" import rawmap with context -%}
{%- from "mysql/supported_sections.yaml" import supported_sections with context -%}
{%- from tpldir ~ "/defaults.yaml" import rawmap with context -%}
{%- from tpldir ~ "/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 =====
......
......@@ -4,8 +4,8 @@
{#-
===== FETCH DATA =====
-#}
{%- from "mysql/defaults.yaml" import rawmap with context -%}
{%- from "mysql/supported_sections.yaml" import supported_sections with context -%}
{%- from tpldir ~ "/defaults.yaml" import rawmap with context -%}
{%- from tpldir ~ "/supported_sections.yaml" import supported_sections with context -%}
{%- set datamap = salt['grains.filter_by'](rawmap, grain='os', merge=salt['pillar.get']('mysql:clients:lookup')) -%}
{#-
===== COMBINE DATA =====
......
......@@ -4,8 +4,8 @@
{#-
===== FETCH DATA =====
-#}
{%- from "mysql/defaults.yaml" import rawmap with context -%}
{%- from "mysql/supported_sections.yaml" import supported_sections with context -%}
{%- from tpldir ~ "/defaults.yaml" import rawmap with context -%}
{%- from tpldir ~ "/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 =====
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment