mirror of
https://github.com/saltstack-formulas/mysql-formula.git
synced 2025-04-15 17:20:25 +00:00
Merge pull request #138 from irtnog/add-schema-context
Feature setting the template context from the mysql:schema pillar
This commit is contained in:
commit
59fd786975
2 changed files with 16 additions and 0 deletions
|
@ -30,8 +30,10 @@ include:
|
|||
- 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) %}
|
||||
{%- set template_context = salt['pillar.get'](['mysql', 'schema', database, 'context']|join(':'), {}) %}
|
||||
{%- if template_type %}
|
||||
- template: {{ template_type }}
|
||||
- context: {{ template_context|yaml }}
|
||||
{% endif %}
|
||||
- user: {{ salt['pillar.get']('mysql:server:user', 'mysql') }}
|
||||
- makedirs: True
|
||||
|
|
|
@ -55,6 +55,20 @@ mysql:
|
|||
load: True
|
||||
source: salt://mysql/files/baz.schema.tmpl
|
||||
template: jinja
|
||||
qux:
|
||||
load: True
|
||||
source: salt://mysql/files/qux.schema.tmpl
|
||||
template: jinja
|
||||
context:
|
||||
encabulator: Turbo
|
||||
girdlespring: differential
|
||||
quux:
|
||||
load: True
|
||||
source: salt://mysql/files/qux.schema.tmpl
|
||||
template: jinja
|
||||
context:
|
||||
encabulator: Retro
|
||||
girdlespring: integral
|
||||
|
||||
# Manage users
|
||||
# you can get pillar for existing server using scripts/import_users.py script
|
||||
|
|
Loading…
Add table
Reference in a new issue