I never got the message to say there was a reply so sorry for the delay in getting back to you.
I have disabled sudo for that play and updated to ansible 1.5.3.
The play now works but does not create a file at /tmp/passwordfile and if I try to use an alternative directory, it errors completely differently
failed: [
g.b4dev.com] => {"failed": true, "parsed": false}
invalid output was: Traceback (most recent call last):
File "/home/wh/.ansible/tmp/ansible-tmp-1394795091.79-153729821362509/mysql_user", line 1561, in <module>
main()
File "/home/wh/.ansible/tmp/ansible-tmp-1394795091.79-153729821362509/mysql_user", line 459, in main
changed = user_add(cursor, user, host, password, priv)
File "/home/wh/.ansible/tmp/ansible-tmp-1394795091.79-153729821362509/mysql_user", line 158, in user_add
cursor.execute("CREATE USER %s@%s IDENTIFIED BY %s", (user,host,password))
File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
self.errorhandler(self, exc, value)
File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
raise errorclass, errorvalue
_mysql_exceptions.OperationalError: (1396, "Operation CREATE USER failed for 'test'@'localhost'")