Create MySQL Tables with Ansible
With the mysql_db
module you can import a MySQL file. So you can simply copy all 3 create statements into one singly text file and import it like this:
- mysql_db: name=my_db state=import target=/tmp/dump.sql.bz2
That example is taken from the above linked docs page, there are more tasks including one which shows you how to copy the file to the host before.