Commit 4f94d9d5 authored by Robin Sonnabend's avatar Robin Sonnabend
Browse files

Set mysql-root password after installing mysql and save it in the password store

parent d8172342
......@@ -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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment