mirror of
https://github.com/saltstack-formulas/mysql-formula.git
synced 2025-04-10 23:01:44 +00:00
Merge pull request #64 from xclusv/feature-schema-templates
Added ability for SQL Schemas to be templates
This commit is contained in:
commit
bc2d65bd74
2 changed files with 8 additions and 0 deletions
|
@ -24,6 +24,10 @@ include:
|
|||
file.managed:
|
||||
- name: /etc/mysql/{{ database }}.schema
|
||||
- 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') }}
|
||||
- makedirs: True
|
||||
|
||||
|
|
|
@ -25,6 +25,10 @@ mysql:
|
|||
source: salt://mysql/files/foo.schema
|
||||
bar:
|
||||
load: False
|
||||
baz:
|
||||
load: True
|
||||
source: salt://mysql/files/baz.schema.tmpl
|
||||
template: jinja
|
||||
|
||||
# Manage users
|
||||
# you can get pillar for existent server using scripts/import_users.py script
|
||||
|
|
Loading…
Add table
Reference in a new issue