You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.3 KiB
47 lines
1.3 KiB
---
|
|
- name: Copy my.cnf global MySQL configuration.
|
|
template:
|
|
src: my.cnf.j2
|
|
dest: "{{ mysql_config_file }}"
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
force: "{{ overwrite_global_mycnf }}"
|
|
notify: restart mysql
|
|
|
|
- name: Verify mysql include directory exists.
|
|
file:
|
|
path: "{{ mysql_config_include_dir }}"
|
|
state: directory
|
|
owner: root
|
|
group: root
|
|
mode: 0755
|
|
when: mysql_config_include_files | length
|
|
|
|
- name: Copy my.cnf override files into include directory.
|
|
template:
|
|
src: "{{ item.src }}"
|
|
dest: "{{ mysql_config_include_dir }}/{{ item.src | basename }}"
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
force: "{{ item.force | default(False) }}"
|
|
with_items: "{{ mysql_config_include_files }}"
|
|
notify: restart mysql
|
|
|
|
- name: Create slow query log file (if configured).
|
|
file: "path={{ mysql_slow_query_log_file }} state=touch"
|
|
when: mysql_slow_query_log_enabled
|
|
|
|
- name: Set ownership on slow query log file (if configured).
|
|
file:
|
|
path: "{{ mysql_slow_query_log_file }}"
|
|
state: file
|
|
owner: mysql
|
|
group: mysql
|
|
mode: 0644
|
|
when: mysql_slow_query_log_enabled
|
|
|
|
- name: Ensure MySQL is started and enabled on boot.
|
|
service: "name={{ mysql_daemon }} state=started enabled={{ mysql_enabled_on_startup }}"
|
|
register: mysql_service_configuration
|
|
|