###
- name: 'Pwgen MySQL User Password'
command: pwgen 12 1
register: mysql_user_pass
- name: 'Add MySQL DB'
mysql_db: 'name={{ username }} encoding=utf8 login_user=root login_password={{ mysql_root_pass }} state=present'
- name: 'Add MySQL user'
mysql_user: 'name={{ username }} password={{ mysql_user_pass.stdout }} priv={{ username }}.*:ALL login_user=root login_password={{ mysql_root_pass }} state=present'