Ansible: How to change MySQL server root password by reprovisioning the server
18
votes
5
answers
47194
views
I have provisioned my server with Ansible playbook. I've used the root/bedrock-Ansible playbook .
One of the tasks was to set up mysql server together with mysql root user password.
Now I urgently need to change this password. The steps I took:
1. I updated variables for Ansible roles
2. I executed the command
ansible-playbook -i hosts/staging server.yml
in order to reprovision the server
All tasks were executed as expected (no changes), but the script failed at
[mariadb | Set root user password]
with this message:
msg: unable to connect to database, check login_user and login_password are correct or ~/.my.cnf has the credentials
My guess is that once MySQL root password has been set, reprovisioning the server cannot change this password.
Is it possible at all to change MySQL root password by reprovisioning the server with Ansible? What are my options?
Asked by luqo33
(285 rep)
May 20, 2015, 05:19 PM
Last activity: Apr 4, 2023, 10:20 AM
Last activity: Apr 4, 2023, 10:20 AM