Skip to content

Commit 84f1aa4

Browse files
Merge pull request #187 from mkotsbak/fix_relative_references_in_templates
Use tpldir for template files too
2 parents 2537583 + 2b55567 commit 84f1aa4

File tree

7 files changed

+22
-12
lines changed

7 files changed

+22
-12
lines changed

mysql/config.sls

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ mysql_server_config:
2020
- template: jinja
2121
- source: salt://{{ tpldir }}/files/server.cnf
2222
{% if os_family in ['Debian', 'Gentoo', 'RedHat'] %}
23+
- context:
24+
tpldir: {{ tpldir }}
2325
- user: root
2426
- group: root
2527
- mode: 644
@@ -33,6 +35,8 @@ mysql_galera_config:
3335
- template: jinja
3436
- source: salt://{{ tpldir }}/files/galera.cnf
3537
{% if os_family in ['Debian', 'Gentoo', 'RedHat'] %}
38+
- context:
39+
tpldir: {{ tpldir }}
3640
- user: root
3741
- group: root
3842
- mode: 644
@@ -46,6 +50,8 @@ mysql_library_config:
4650
- template: jinja
4751
- source: salt://{{ tpldir }}/files/client.cnf
4852
{% if os_family in ['Debian', 'Gentoo', 'RedHat'] %}
53+
- context:
54+
tpldir: {{ tpldir }}
4955
- user: root
5056
- group: root
5157
- mode: 644
@@ -59,6 +65,8 @@ mysql_clients_config:
5965
- template: jinja
6066
- source: salt://{{ tpldir }}/files/mysql-clients.cnf
6167
{% if os_family in ['Debian', 'Gentoo', 'RedHat'] %}
68+
- context:
69+
tpldir: {{ tpldir }}
6270
- user: root
6371
- group: root
6472
- mode: 644
@@ -76,6 +84,8 @@ mysql_config:
7684
{% else %}
7785
- source: salt://{{ tpldir }}/files/my.cnf
7886
{% endif %}
87+
- context:
88+
tpldir: {{ tpldir }}
7989
{% if os_family in ['Debian', 'Gentoo', 'RedHat'] %}
8090
- user: root
8191
- group: root

mysql/files/client.cnf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
{#-
55
===== FETCH DATA =====
66
-#}
7-
{%- from "mysql/defaults.yaml" import rawmap with context -%}
8-
{%- from "mysql/supported_sections.yaml" import supported_sections with context -%}
7+
{%- from tpldir ~ "/defaults.yaml" import rawmap with context -%}
8+
{%- from tpldir ~ "/supported_sections.yaml" import supported_sections with context -%}
99
{%- set datamap = salt['grains.filter_by'](rawmap, grain='os', merge=salt['pillar.get']('mysql:library:lookup')) -%}
1010
{#-
1111
===== COMBINE DATA =====

mysql/files/galera.cnf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
{#-
55
===== FETCH DATA =====
66
-#}
7-
{%- from "mysql/defaults.yaml" import rawmap with context -%}
8-
{%- from "mysql/supported_sections.yaml" import supported_sections with context -%}
7+
{%- from tpldir ~ "/defaults.yaml" import rawmap with context -%}
8+
{%- from tpldir ~ "/supported_sections.yaml" import supported_sections with context -%}
99
{%- set datamap = salt['grains.filter_by'](rawmap, grain='os', merge=salt['pillar.get']('mysql:galera:lookup')) -%}
1010
{#-
1111
===== COMBINE DATA =====

mysql/files/my-include.cnf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
{#-
55
===== FETCH DATA =====
66
-#}
7-
{%- from "mysql/defaults.yaml" import rawmap with context -%}
8-
{%- from "mysql/supported_sections.yaml" import supported_sections with context -%}
7+
{%- from tpldir ~ "/defaults.yaml" import rawmap with context -%}
8+
{%- from tpldir ~ "/supported_sections.yaml" import supported_sections with context -%}
99
{%- set datamap = salt['grains.filter_by'](rawmap, grain='os', merge=salt['pillar.get']('mysql:global:lookup')) -%}
1010
{#-
1111
===== COMBINE DATA =====

mysql/files/my.cnf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
{#-
55
===== FETCH DATA =====
66
-#}
7-
{%- from "mysql/defaults.yaml" import rawmap with context -%}
8-
{%- from "mysql/supported_sections.yaml" import supported_sections with context -%}
7+
{%- from tpldir ~ "/defaults.yaml" import rawmap with context -%}
8+
{%- from tpldir ~ "/supported_sections.yaml" import supported_sections with context -%}
99
{%- set datamap = salt['grains.filter_by'](rawmap, grain='os', merge=salt['pillar.get']('mysql:server:lookup')) -%}
1010
{#-
1111
===== COMBINE DATA =====

mysql/files/mysql-clients.cnf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
{#-
55
===== FETCH DATA =====
66
-#}
7-
{%- from "mysql/defaults.yaml" import rawmap with context -%}
8-
{%- from "mysql/supported_sections.yaml" import supported_sections with context -%}
7+
{%- from tpldir ~ "/defaults.yaml" import rawmap with context -%}
8+
{%- from tpldir ~ "/supported_sections.yaml" import supported_sections with context -%}
99
{%- set datamap = salt['grains.filter_by'](rawmap, grain='os', merge=salt['pillar.get']('mysql:clients:lookup')) -%}
1010
{#-
1111
===== COMBINE DATA =====

mysql/files/server.cnf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
{#-
55
===== FETCH DATA =====
66
-#}
7-
{%- from "mysql/defaults.yaml" import rawmap with context -%}
8-
{%- from "mysql/supported_sections.yaml" import supported_sections with context -%}
7+
{%- from tpldir ~ "/defaults.yaml" import rawmap with context -%}
8+
{%- from tpldir ~ "/supported_sections.yaml" import supported_sections with context -%}
99
{%- set datamap = salt['grains.filter_by'](rawmap, grain='os', merge=salt['pillar.get']('mysql:server:lookup')) -%}
1010
{#-
1111
===== COMBINE DATA =====

0 commit comments

Comments
 (0)