mysql_user
ansible module as mysql warns that you must change it using a client that supports expired passwords
- name: Find temporary password
shell: "echo `grep 'temporary.*root@localhost' /var/log/mysqld.log | sed 's/.*root@localhost: //'`"
register: mysql_root_password_temp
tags: register
- name: Set new password from temporary password
shell: 'mysql -e "SET PASSWORD = PASSWORD(''{{ mysql_root_password }}'');" --connect-expired-password -uroot -p"{{ mysql_root_password_temp.stdout }}"'
\'
use ''