Specifically, you’ll want something like this example:
# Creates database user 'bob' and password '12345' with all database privileges and 'WITH GRANT OPTION'
- mysql_user: name=bob password=12345 priv=*.*:ALL,GRANT state=present
The “host” parameter for that module controls the host portion of the user login information. So you should set host=“*” to allow connections from any remote host.
Do you mean that host=“%” does not work for you as a parameter to mysql_user module? This would be really strange because I have tested it with Ansible 1.6.1 and it works as expected. If you can connect from the local machine, run the following SQL “use mysql;select * from user;” to see what has been added (or what is missing).