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
247a4556
Commit
247a4556
authored
Sep 22, 2017
by
Lars Beckers
Browse files
mysql: change retrieval of root password from store
parent
0ec0e205
Changes
1
Hide whitespace changes
Inline
Side-by-side
mysql/tasks/main.yml
View file @
247a4556
...
...
@@ -29,20 +29,12 @@
-
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
no_log
:
True
tags
:
-
password
-
mysql
-
name
:
ensure the mysql root user exists and has the correct password
mysql_user
:
name
:
root
password
:
"
{{
mysql_root_password.password
}}"
password
:
"
{{
lookup('passwordstore',
'db/{{
ansible_hostname
}}-mysql
create=true
length=20')
}}"
login_user
:
root
login_password
:
"
{{
mysql_root_password.password
}}"
login_password
:
"
{{
lookup('passwordstore',
'db/{{
ansible_hostname
}}-mysql
create=true
length=20')
}}"
register
:
mysql_root_creation_result
no_log
:
True
ignore_errors
:
yes
...
...
@@ -53,7 +45,7 @@
-
name
:
initialize the mysql root user
mysql_user
:
name
:
root
password
:
"
{{
mysql_root_password.password
}}"
password
:
"
{{
lookup('passwordstore',
'db/{{
ansible_hostname
}}-mysql
create=true
length=20')
}}"
no_log
:
True
when
:
mysql_root_creation_result|failed
tags
:
...
...
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