Skip to content

Commit bc2d65b

Browse files
committed
Merge pull request saltstack-formulas#64 from xclusv/feature-schema-templates
Added ability for SQL Schemas to be templates
2 parents 5d74223 + 55728f0 commit bc2d65b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

mysql/database.sls

+4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ include:
2424
file.managed:
2525
- name: /etc/mysql/{{ database }}.schema
2626
- source: {{ salt['pillar.get'](['mysql', 'schema', database, 'source']|join(':')) }}
27+
{%- set template_type = salt['pillar.get'](['mysql', 'schema', database, 'template']|join(':'), False) %}
28+
{%- if template_type %}
29+
- template: {{ template_type }}
30+
{% endif %}
2731
- user: {{ salt['pillar.get']('mysql:server:user', 'mysql') }}
2832
- makedirs: True
2933

pillar.example

+4
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ mysql:
2525
source: salt://mysql/files/foo.schema
2626
bar:
2727
load: False
28+
baz:
29+
load: True
30+
source: salt://mysql/files/baz.schema.tmpl
31+
template: jinja
2832

2933
# Manage users
3034
# you can get pillar for existent server using scripts/import_users.py script

0 commit comments

Comments
 (0)