In this list of mysql db modules for Ansbile, there\'s one for creating a db, or creating a user, etc.
I would like to run a query against a pre-existing table and u
This is approximately how to do it (but it is untested):
- name: Retrieve stuff from mysql
  command: >
    mysql --user=alice --password=topsecret dbname
    --host=147.102.160.1 --batch --skip-column-names
    --execute="SELECT stuff from stuff_table"
  register: stuff
  check_mode: no
  changed_when: False
- name: Do something with stuff
  debug: "{{ item }}"
  with_items: stuff.stdout_lines
Documented here.