mirror of
https://github.com/saltstack-formulas/mysql-formula.git
synced 2025-04-17 10:10:30 +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
|
- 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) %}
|
{%- 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 %}
|
{%- if template_type %}
|
||||||
- template: {{ template_type }}
|
- template: {{ template_type }}
|
||||||
|
- context: {{ template_context|yaml }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- user: {{ salt['pillar.get']('mysql:server:user', 'mysql') }}
|
- user: {{ salt['pillar.get']('mysql:server:user', 'mysql') }}
|
||||||
- makedirs: True
|
- makedirs: True
|
||||||
|
|
|
@ -55,6 +55,20 @@ mysql:
|
||||||
load: True
|
load: True
|
||||||
source: salt://mysql/files/baz.schema.tmpl
|
source: salt://mysql/files/baz.schema.tmpl
|
||||||
template: jinja
|
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
|
# Manage users
|
||||||
# you can get pillar for existing server using scripts/import_users.py script
|
# you can get pillar for existing server using scripts/import_users.py script
|
||||||
|
|
Loading…
Add table
Reference in a new issue