2017-08-28 09:20:50 +00:00
|
|
|
---
|
|
|
|
- include: centos.yml
|
|
|
|
when: ansible_distribution == 'CentOS' and ansible_distribution_major_version|int >= 6
|
|
|
|
|
|
|
|
- include: ubuntu.yml
|
|
|
|
when: ansible_distribution == 'Ubuntu'
|
|
|
|
|
2017-09-05 14:05:28 +00:00
|
|
|
- name: Add configuration
|
|
|
|
template: src={{ mysql_conf_tpl }} dest={{ mysql_conf_dir[ansible_distribution] }}/{{ mysql_conf_file }} owner=root group=root mode=0644
|
|
|
|
when: mysql_conf_tpl != 'change_me' and ansible_distribution != 'Debian'
|
|
|
|
notify: restart mysql
|
|
|
|
|
2017-08-28 09:20:50 +00:00
|
|
|
- include: debian.yml
|
|
|
|
when: ansible_distribution == 'Debian'
|
|
|
|
|
|
|
|
- name: Add configuration
|
2017-09-05 14:05:28 +00:00
|
|
|
template: src=files/debian_mariadb_config.cnf dest={{ mysql_conf_dir[ansible_distribution] }}/{{ mysql_conf_file }} owner=root group=root mode=0644
|
|
|
|
when: mysql_conf_tpl != 'change_me' and ansible_distribution == 'Debian'
|
2017-08-28 09:20:50 +00:00
|
|
|
notify: restart mysql
|
|
|
|
|
|
|
|
- name: Start and enable service
|
|
|
|
service: name=mysql state=started enabled=yes
|
|
|
|
|
2017-09-07 03:27:58 +00:00
|
|
|
- debug:
|
|
|
|
msg: "{{ mysql_root_password }}"
|
|
|
|
|
2017-08-28 09:20:50 +00:00
|
|
|
- include: mysql_secure_installation.yml
|
2017-09-05 14:05:28 +00:00
|
|
|
when: mysql_root_password is defined
|
|
|
|
|
2017-08-28 09:20:50 +00:00
|
|
|
- debug: var=mysql_secure_installation
|
|
|
|
when: mysql_secure_installation and mysql_root_password is defined
|