ansible.mysql_db(3) - Linux man page
Name
mysql_db - Add or remove MySQL databases from a remote host.
Description
Add or remove MySQL databases from a remote host.
Options
collation
- Collation mode
- encoding
- Encoding mode
- login_host
- Host running the database (default: localhost)
- login_password
- The password used to authenticate with
- login_user
- The username used to authenticate with
- name
name of the database to add or remove(required)
state
The database state Choices: present,absent,dump,import. (default: present)
target
Where to dump/get the .sql file(required)."
Notes
Requires the MySQLdb Python package on the remote host. For Ubuntu, this is as easy as apt-get install python-mysqldb. (See apt.)
Both login_password and login_user 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.
Examples
Create a new database with name 'bobdata'
mysql_db: db=bobdata state=present
Author
Mark Theunissen
See Also
ansible(1), http://ansible.github.com/modules.html#mysql-db