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 }}"