Skip to content
Snippets Groups Projects
Commit bc2d65bd authored by Nitin Madhok's avatar Nitin Madhok
Browse files

Merge pull request #64 from xclusv/feature-schema-templates

Added ability for SQL Schemas to be templates
parents 5d74223c 55728f02
No related branches found
No related tags found
No related merge requests found
...@@ -24,6 +24,10 @@ include: ...@@ -24,6 +24,10 @@ include:
file.managed: file.managed:
- name: /etc/mysql/{{ database }}.schema - name: /etc/mysql/{{ database }}.schema
- source: {{ salt['pillar.get'](['mysql', 'schema', database, 'source']|join(':')) }} - source: {{ salt['pillar.get'](['mysql', 'schema', database, 'source']|join(':')) }}
{%- set template_type = salt['pillar.get'](['mysql', 'schema', database, 'template']|join(':'), False) %}
{%- if template_type %}
- template: {{ template_type }}
{% endif %}
- user: {{ salt['pillar.get']('mysql:server:user', 'mysql') }} - user: {{ salt['pillar.get']('mysql:server:user', 'mysql') }}
- makedirs: True - makedirs: True
......
...@@ -25,6 +25,10 @@ mysql: ...@@ -25,6 +25,10 @@ mysql:
source: salt://mysql/files/foo.schema source: salt://mysql/files/foo.schema
bar: bar:
load: False load: False
baz:
load: True
source: salt://mysql/files/baz.schema.tmpl
template: jinja
# Manage users # Manage users
# you can get pillar for existent server using scripts/import_users.py script # you can get pillar for existent server using scripts/import_users.py script
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment