I use this role in a Vagrant dev environment where the /var/lib/mysql dir is persisted between instances of the VMs. This means that there is a scenario where the /root/.my.cnf may not exist while the mysql already does have a root password set. Placing the template task before executing any mysql_user tasks solves this.
I use this role in a Vagrant dev environment where the /var/lib/mysql dir is persisted between instances of the VMs. This means that there is a scenario where the /root/.my.cnf may not exist while the mysql already does have a root password set. Placing the template task before executing any mysql_user tasks solves this.