diff --git a/library/mysql_db b/library/mysql_db index 6752d9f7ba3..68df14ccab1 100755 --- a/library/mysql_db +++ b/library/mysql_db @@ -19,6 +19,60 @@ # You should have received a copy of the GNU General Public License # along with Ansible. If not, see . +DOCUMENTATION = ''' +--- +module: mysql_db +short_description: Add or remove MySQL databases from a remote host. +description: + - Add or remove MySQL databases from a remote host. +version_added: "0.6" +options: + name: + description: + - name of the database to add or remove + required: true + default: null + login_user: + description: + - The username used to authenticate with + required: false + default: null + login_password: + description: + - The passwordused to authenticate with + required: false + default: null + login_host: + description: + - Host running the database + required: false + default: localhost + state: + description: + - The database state + required: false + default: present + choices: [ "present", "absent" ] + collation: + description: + - Collation mode + required: false + default: null + encoding: + description: + - Encoding mode + required: false + default: null +examples: + - code: mysql_db db=bobdata state=present + description: create a new database with name 'bobdata' +notes: + - Requires the MySQLdb Python package on the remote host. For Ubuntu, this is as easy as apt-get install python-mysqldb. + - Both 'login_password' and 'login_username' are required when you are passing credentials. If none are present, the module will attempt to read the credentials from ~/.my.cnf, and finally fall back to using the MySQL default login of 'root' with no password. +requirements: [ ConfigParser ] +author: Mark Theunissen +''' + import ConfigParser try: import MySQLdb