Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Ansible shared-roles
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Vojtěch Myslivec
Ansible shared-roles
Commits
f39afd70
Verified
Commit
f39afd70
authored
5 years ago
by
Vojtěch Myslivec
Browse files
Options
Downloads
Patches
Plain Diff
mariadb: Allow to specify extra db users
parent
f0024f48
No related branches found
Branches containing commit
Tags
v30.0
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
mariadb/README.md
+6
-0
6 additions, 0 deletions
mariadb/README.md
mariadb/defaults/main.yml
+3
-0
3 additions, 0 deletions
mariadb/defaults/main.yml
mariadb/tasks/databases.yml
+12
-0
12 additions, 0 deletions
mariadb/tasks/databases.yml
mariadb/tasks/main.yml
+1
-0
1 addition, 0 deletions
mariadb/tasks/main.yml
with
22 additions
and
0 deletions
mariadb/README.md
+
6
−
0
View file @
f39afd70
...
...
@@ -34,6 +34,12 @@ Each series can be switched off by appropriate flag in variables.
| .username | no |
`name`
| Name of a database user; defaults to database name |
| .host | no | % | The 'host' part of the MySQL username |
| .password | no | | Password for database user |
| | | | |
| mariadb_extra_users | no | | List of databases; Each item is a dictionary with following parameters |
| .username | yes | | Name of a database user |
| .host | no | % | The 'host' part of the MySQL username |
| .password | no | | Password for database user |
| .privs | no | | List of database priviledges in
`db.table:priv1,priv2`
format |
## Examples
...
...
This diff is collapsed.
Click to expand it.
mariadb/defaults/main.yml
+
3
−
0
View file @
f39afd70
...
...
@@ -8,6 +8,9 @@ mariadb_bind_address: '127.0.0.1'
mariadb_slow_query_time
:
2
mariadb_tuning
:
'
'
mariadb_databases
:
[]
mariadb_extra_users
:
[]
mariadb_backup
:
dir
:
'
/var/backup/mysql'
...
...
This diff is collapsed.
Click to expand it.
mariadb/tasks/databases.yml
+
12
−
0
View file @
f39afd70
...
...
@@ -24,4 +24,16 @@
loop_control
:
label
:
'
{{
item.name
}}'
-
name
:
Create database extra users
mysql_user
:
name
:
'
{{
item.username
}}'
password
:
'
{{
item.password|default(omit)
}}'
host
:
'
{{
item.host|default("%")
}}'
priv
:
'
{{
item.privs|default([])
|
join("/")
}}'
state
:
'
present'
login_unix_socket
:
'
/var/run/mysqld/mysqld.sock'
loop
:
'
{{
mariadb_extra_users
}}'
loop_control
:
label
:
'
{{
item.username
}}'
...
This diff is collapsed.
Click to expand it.
mariadb/tasks/main.yml
+
1
−
0
View file @
f39afd70
...
...
@@ -37,6 +37,7 @@
import_tasks
:
'
databases.yml'
tags
:
-
databases
-
users
-
name
:
Setup database backups
...
...
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