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
e6cf0013
Commit
e6cf0013
authored
10 years ago
by
René Jochum
Browse files
Options
Downloads
Patches
Plain Diff
Smaller changes.
Signed-off-by:
René Jochum
<
rene@jochums.at
>
parent
8a00a961
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
mysql/init.sls
+0
-7
0 additions, 7 deletions
mysql/init.sls
mysql/user.sls
+23
-2
23 additions, 2 deletions
mysql/user.sls
with
23 additions
and
9 deletions
mysql/init.sls
+
0
−
7
View file @
e6cf0013
...
@@ -25,11 +25,4 @@ extend:
...
@@ -25,11 +25,4 @@ extend:
- require_in:
- require_in:
{{ requisites('mysql_database', db_states) }}
{{ requisites('mysql_database', db_states) }}
{{ requisites('mysql_user', user_states) }}
{{ requisites('mysql_user', user_states) }}
{% for state in user_states %}
{{ state }}:
mysql_user:
- require:
- sls: mysql.database
{% endfor %}
{% endif %}
{% endif %}
This diff is collapsed.
Click to expand it.
mysql/user.sls
+
23
−
2
View file @
e6cf0013
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
include:
include:
- mysql.python
- mysql.python
{% for name, user in salt['pillar.get']('mysql:user', {}).items() %}
{% for name, user in salt['pillar.get']('mysql:user', {}).
iter
items() %}
{% set user_host = salt['pillar.get']('mysql:user:%s:host'|format(name)) %}
{% set user_host = salt['pillar.get']('mysql:user:%s:host'|format(name)) %}
{% if user_host != '' %}
{% if user_host != '' %}
...
@@ -40,6 +40,26 @@ include:
...
@@ -40,6 +40,26 @@ include:
{% endif %}
{% endif %}
- connection_charset: utf8
- connection_charset: utf8
{%- if 'grants' in user %}
{{ state_id ~ '_grants' }}:
mysql_grants.present:
- name: {{ name }}
- grant: {{ user['grants']|join(",") }}
- database: '*.*'
- grant_option: {{ user['grant_option'] | default(False) }}
- user: {{ name }}
- host: '{{ host }}'
- connection_host: localhost
- connection_user: root
{% if mysql_root_pass -%}
- connection_pass: '{{ mysql_root_pass }}'
{% endif %}
- connection_charset: utf8
- require:
- mysql_user: {{ state_id }}
{% endif %}
{%- if 'databases' in user %}
{% for db in user['databases'] %}
{% for db in user['databases'] %}
{{ state_id ~ '_' ~ loop.index0 }}:
{{ state_id ~ '_' ~ loop.index0 }}:
mysql_grants.present:
mysql_grants.present:
...
@@ -56,8 +76,9 @@ include:
...
@@ -56,8 +76,9 @@ include:
{% endif %}
{% endif %}
- connection_charset: utf8
- connection_charset: utf8
- require:
- require:
- mysql_user: {{
name
}}
- mysql_user: {{
state_id
}}
{% endfor %}
{% endfor %}
{% endif %}
{% do user_states.append(state_id) %}
{% do user_states.append(state_id) %}
{% endfor %}
{% endfor %}
...
...
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