Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
infra
ansible-shared
databases
Commits
4f94d9d5
Commit
4f94d9d5
authored
Jan 20, 2016
by
Robin Sonnabend
Browse files
Set mysql-root password after installing mysql and save it in the password store
parent
d8172342
Changes
1
Hide whitespace changes
Inline
Side-by-side
mysql/tasks/main.yml
View file @
4f94d9d5
...
...
@@ -15,3 +15,31 @@
tags
:
-
service
-
mysql
-
name
:
get or create the mysql root password
local_action
:
pass name="db/{{ ansible_hostname }}-mysql" state=present generate=20 store=FSMPI_PASSWORD_STORE_DIR limit=yes
register
:
mysql_root_password
tags
:
-
password
-
mysql
-
name
:
ensure the mysql root user exists and has the correct password
mysql_user
:
name
:
root
password
:
"
{{
mysql_root_password.password
}}"
login_user
:
root
login_password
:
"
{{
mysql_root_password.password
}}"
register
:
mysql_root_creation_result
ignore_errors
:
yes
tags
:
-
mysql
-
config
-
name
:
initialize the mysql root user
mysql_user
:
name
:
root
password
:
"
{{
mysql_root_password.password
}}"
when
:
mysql_root_creation_result|failed
tags
:
-
mysql
-
config
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment