Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mysql-formula
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
salt
mysql-formula
Commits
71c12e4a
Commit
71c12e4a
authored
7 years ago
by
Eduardo Speroni
Browse files
Options
Downloads
Patches
Plain Diff
Added charset and collate support, ensuring backwards compatibility
parent
6403ba2e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
mysql/database.sls
+6
-1
6 additions, 1 deletion
mysql/database.sls
pillar.example
+5
-1
5 additions, 1 deletion
pillar.example
with
11 additions
and
2 deletions
mysql/database.sls
+
6
−
1
View file @
71c12e4a
...
...
@@ -12,8 +12,9 @@
include:
- mysql.python
{% for database in salt['pillar.get']('mysql:database', []) %}
{% for database
_obj
in salt['pillar.get']('mysql:database', []) %}
{% set state_id = 'mysql_db_' ~ loop.index0 %}
{% set database = database_obj.get('name') if database_obj is mapping else database_obj %}
{{ state_id }}:
mysql_database.present:
- name: {{ database }}
...
...
@@ -22,6 +23,10 @@ include:
{% if mysql_salt_pass %}
- connection_pass: '{{ mysql_salt_pass }}'
{% endif %}
{% if database_obj is mapping %}
- character_set: {{ database_obj.get('character_set', '') }}
- collate: {{ database_obj.get('collate', '') }}
{% endif %}
- connection_charset: utf8
{% if salt['pillar.get'](['mysql', 'schema', database, 'load']|join(':'), False) %}
...
...
This diff is collapsed.
Click to expand it.
pillar.example
+
5
−
1
View file @
71c12e4a
...
...
@@ -49,8 +49,12 @@ mysql:
# Manage databases
database:
# Simple definition using default charset and collate
- foo
- bar
# Detailed definition
- name: bar
character_set: utf8
collate: utf8_general_ci
schema:
foo:
load: True
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment