Problem with mysql core modules when host and/or port are non default

According to the docs, Ansible started to support the config file (default: ~/.my.cnf) when connecting to the MySQL database and it reads the username and password from that file to be used when the arguments for login_user and login_password are not provided.

However, the same should be the case for login_host and login_port, but that doesn’t work because the main() functions in mysql_db and mysql_user modules are defaulting to localhost and 3306.

As a result, those default values get used when no module arguments are provided but that means that values for host and port in ~/.my.cnf won’t be used when provided there.

Proposal: both, login_host and login_port should default to none in both the mysql_db and mysql_user modules. Then, in mysql_connect their values should be added to the config list if they were provided as arguments, just exactly like already done with login_user and login_password.

Thoughts?