I an remote to server and login using root just fine, but ansible task is failing

My task throws an error as follows:

TASK [mysql : Update MySQL root password for all root accounts] ************************************************************************
failed: [1.2.3.4] (item=127.0.0.1) => {“changed”: false, “item”: “127.0.0.1”, “msg”: “unable to connect to database, check login_user and login_password are correct or /root/.my.cnf has the credentials. Exception message: (1045, "Access denied for user ‘root’@‘localhost’ (using password: YES)")”}
failed: [1.2.3.4] (item=::1) => {“changed”: false, “item”: “::1”, “msg”: “unable to connect to database, check login_user and login_password are correct or /root/.my.cnf has the credentials. Exception message: (1045, "Access denied for user ‘root’@‘localhost’ (using password: YES)")”}
failed: [1.2.3.4] (item=localhost) => {“changed”: false, “item”: “localhost”, “msg”: “unable to connect to database, check login_user and login_password are correct or /root/.my.cnf has the credentials. Exception message: (1045, "Access denied for user ‘root’@‘localhost’ (using password: YES)")”}

If I remote into the user using the user ‘deploy’ I can do the following just fine:

mysql -h 127.0.0.1 -u root -p

And it logs into the mysql server.

Why is it having an issue with ansible doing it?

my main yml file is doing this:

remote_user: deploy
become: yes
become_method: sudo
gather_facts: no

mysql/tasks/main.yml is: