###
- 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'
- name: 'Default configs Apache2 & PHP'
template: 'src={{item.src}} dest={{item.dest}} backup=yes'
with_items:
- { src: 'templates/apache2/000-default.conf.j2', dest: '/etc/apache2/sites-available/000-default.conf' }
- { src: 'templates/php/7.0/cli/php.ini.j2', dest: '/etc/php/7.0/cli/php.ini' }
- { src: 'templates/php/7.0/apache2/php.ini.j2', dest: '/etc/php/7.0/apache2/php.ini' }
notify:
- 'apache2 reload'