From 1e75c2f3e3274ba8b457a1eda90dfaec109cc723 Mon Sep 17 00:00:00 2001 From: David Glaser Date: Wed, 6 Apr 2016 10:45:04 -0400 Subject: [PATCH] Verify that datadir has been created and selinux context set. Currently selinux context set separately because I'm not sure that Ubuntu has it installed in all cases. --- tasks/configure.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 }}"