diff --git a/mysql/config.sls b/mysql/config.sls index 2f40051..20757da 100644 --- a/mysql/config.sls +++ b/mysql/config.sls @@ -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 diff --git a/mysql/files/client.cnf b/mysql/files/client.cnf index 0dee293..5e78100 100644 --- a/mysql/files/client.cnf +++ b/mysql/files/client.cnf @@ -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 ===== diff --git a/mysql/files/galera.cnf b/mysql/files/galera.cnf index 982dafd..b6e1c0e 100644 --- a/mysql/files/galera.cnf +++ b/mysql/files/galera.cnf @@ -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 ===== diff --git a/mysql/files/my-include.cnf b/mysql/files/my-include.cnf index 5e65b7c..96a441a 100644 --- a/mysql/files/my-include.cnf +++ b/mysql/files/my-include.cnf @@ -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 ===== diff --git a/mysql/files/my.cnf b/mysql/files/my.cnf index f36b633..c0594e2 100644 --- a/mysql/files/my.cnf +++ b/mysql/files/my.cnf @@ -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 ===== diff --git a/mysql/files/mysql-clients.cnf b/mysql/files/mysql-clients.cnf index d56177a..a148c2d 100644 --- a/mysql/files/mysql-clients.cnf +++ b/mysql/files/mysql-clients.cnf @@ -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 ===== diff --git a/mysql/files/server.cnf b/mysql/files/server.cnf index abd6b5b..cc7440f 100644 --- a/mysql/files/server.cnf +++ b/mysql/files/server.cnf @@ -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 =====