From ec015720b018b5ab3ddb2ecc7df0477155d704aa Mon Sep 17 00:00:00 2001 From: Bart Geesink Date: Mon, 2 Dec 2024 10:32:51 +0100 Subject: [PATCH] Mariadb docker: Add a mariadb config file --- roles/mariadbdocker/files/settings.cnf | 2 ++ roles/mariadbdocker/tasks/main.yml | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 roles/mariadbdocker/files/settings.cnf diff --git a/roles/mariadbdocker/files/settings.cnf b/roles/mariadbdocker/files/settings.cnf new file mode 100644 index 000000000..84a706c29 --- /dev/null +++ b/roles/mariadbdocker/files/settings.cnf @@ -0,0 +1,2 @@ +[mariadb] +sql_mode=NO_ENGINE_SUBSTITUTION diff --git a/roles/mariadbdocker/tasks/main.yml b/roles/mariadbdocker/tasks/main.yml index a50f3723a..cd748f83f 100644 --- a/roles/mariadbdocker/tasks/main.yml +++ b/roles/mariadbdocker/tasks/main.yml @@ -3,6 +3,21 @@ community.docker.docker_volume: name: openconext_mariadb state: present +- name: Create MariaDB config dir + ansible.builtin.file: + path: /opt/openconext/mariadb/ + owner: root + group: root + mode: "0755" + state: directory + +- name: Copy mariadb config file + ansible.builtin.copy: + src: settings.cnf + dest: /opt/openconext/mariadb/settings.cnf + owner: root + group: root + mode: "0644" - name: Create MariaDB network community.docker.docker_network: @@ -26,6 +41,9 @@ - type: volume source: openconext_mariadb target: /var/lib/mysql + - type: bind + source: /opt/openconext/mariadb/settings.cnf + target: /etc/mysql/conf.d/settings.cnf env: MARIADB_ROOT_PASSWORD: "{{ mariadb_root_password }}"