---
# This playbook will install mysql and create db user and give permissions.

- name: Install MySQL package
  apt: name=mysql-server state=present

- name: Start mysqld service
  service: name=mysqld state=started enabled=yes

- name: Create database
  mysql_db: name={{ dbname }} state=present

- name: Create database user
  mysql_user: name={{ dbuser }} password={{ dbpass }} priv=*.*:ALL host='%' state=present

---
# This playbook will install mysql and create db user and give permissions.

- name: Install MySQL package
  apt: name=mysql-server state=present

- name: Start mysqld service
  service: name=mysqld state=started enabled=yes

Move create db and user into wordpress task
Move create db and user into wordpress task
