- name: create a new database mysql_db: # login_unix_socket: /var/run/mysqld/mysqld.sock name: '{{ DB_NAME }}' state: present - name: create a new user in database mysql_user: # login_unix_socket: /var/run/mysqld/mysqld.sock name: '{{ DB_USER_NAME }}' password: '{{ DB_USER_PASSWORD }}' priv: '{{ DB_NAME }}.*:ALL' host: '{{ DB_HOST }}' state: present