ansible/ansible — pull request #7484 by himyouten (2014-05-21 21:59:50+00:00)
Title: Adding defaults_file to mysql_db module

I've added a defaults_file parameter to the mysql_db module to allow loading different my.cnf files.

This allows having various my.cnf for different roles without having to put the user/pass into the book all the time.

E.g.:
mysql_db: name=vmp state=dump target=/tmp/dump.sql defaults_file=~/.my-prod-slave.cnf

The only changes were in the loading of the parameters and not the import, dump, present and absent logic.

Logic was changed to always load the my.cnf (defaults to ~/.my.cnf if defaults_file is not set) and then overriding the settings with those passed in the playbook. The following my.cnf properties are read, user, password, host, port and socket.

User and password are not required anymore, but defaults to "root" and empty string, respectively.

The functionality of the original was great, we just preferred to use defaults files vs. explicitly setting the user/pass into the playbook.

Cheers
Himmy