diff --git a/tasks/configure.yml b/tasks/configure.yml index 65ebcc1..ad5ec4c 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -33,6 +33,19 @@ file: "path={{ mysql_slow_query_log_file }} state=touch" when: mysql_slow_query_log_enabled +- name: Create datadir if it does not exist + file: + path: "{{ mysql_datadir }}" + state: directory + owner: mysql + group: mysql + mode: 0755 + +- name: Set selinux context on datadir + file: + path: "{{ mysql_datadir }}" + setype: mysqld_db_t + - name: Set ownership on slow query log file (if configured). file: path: "{{ mysql_slow_query_log_file }}"