Skip to content
Snippets Groups Projects
Commit 247a4556 authored by Lars Beckers's avatar Lars Beckers
Browse files

mysql: change retrieval of root password from store

parent 0ec0e205
No related branches found
No related tags found
No related merge requests found
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment