---
- name: apt-get install mysql
  apt:
    name: '{{ item }}'
    state: present
    update_cache: yes
    cache_valid_time: 3600
  with_items:
    - mysql-server
    - mysql-client
    - python-mysqldb
    - anacron

- name: Create Wordpress MySQL database
  mysql_db:
    collation: utf8_general_ci
    encoding: utf8
    name: wordpress
    state: present

- name: Create Wordpress MySQL account
  mysql_user:
    name: wordpress
    password: wordpress
    priv: 'wordpress.*:SELECT,INSERT,UPDATE,DELETE,CREATE,INDEX'
    state: present
