diff --git a/roles/services/files/z90-vn.cnf b/roles/services/files/mariaconfigfiles/z90-vn.cnf similarity index 98% rename from roles/services/files/z90-vn.cnf rename to roles/services/files/mariaconfigfiles/z90-vn.cnf index b6b244b..1911135 100644 --- a/roles/services/files/z90-vn.cnf +++ b/roles/services/files/mariaconfigfiles/z90-vn.cnf @@ -6,7 +6,7 @@ lc_time_names = es_ES character-set-server = utf8 collation-server = utf8_unicode_ci explicit_defaults_for_timestamp = ON -datadir = /var/lib/mysql +datadir = /mnt/mysqldata/mysql tmpdir = /mnt/mysqltmp log_bin_trust_function_creators = 1 sql_mode = NO_ENGINE_SUBSTITUTION diff --git a/roles/services/files/z92-testing.cnf b/roles/services/files/mariaconfigfiles/z92-testing.cnf similarity index 100% rename from roles/services/files/z92-testing.cnf rename to roles/services/files/mariaconfigfiles/z92-testing.cnf diff --git a/roles/services/files/z95-production.cnf b/roles/services/files/mariaconfigfiles/z95-production.cnf similarity index 100% rename from roles/services/files/z95-production.cnf rename to roles/services/files/mariaconfigfiles/z95-production.cnf diff --git a/roles/services/tasks/mariadb.yml b/roles/services/tasks/mariadb.yml index d975218..8866ad9 100644 --- a/roles/services/tasks/mariadb.yml +++ b/roles/services/tasks/mariadb.yml @@ -97,8 +97,9 @@ owner: root group: root mode: u=rw,g=r,o=r - with_fileglob: - - "files/z9*.cnf" + with_items: + - "files/mariaconfigfiles/z90-vn.cnf" + - "files/mariaconfigfiles/z95-production" notify: restart-mariadb - name: Reminder to check mount points @@ -119,8 +120,9 @@ owner: root group: root mode: u=rw,g=r,o=r - with_fileglob: - - "files/test/z9*.cnf" + with_items: + - "files/mariaconfigfiles/z90-vn.cnf" + - "files/mariaconfigfiles/z92-testing.cnf" notify: restart-mariadb - name: Reminder to check mount points @@ -128,4 +130,12 @@ msg: | Remember to check the following mount points: - /mnt/mysqltmp - Make sure they are correctly configured and accessible. \ No newline at end of file + Make sure they are correctly configured and accessible. + +- name: Set MariaDB local configuration file + template: + src: templates/z99-local.cnf + dest: /etc/mysql/mariadb.conf.d/ + owner: root + group: root + mode: u=rw,g=r,o=r \ No newline at end of file diff --git a/roles/services/templates/z99-local.cnf b/roles/services/templates/z99-local.cnf index 58249ee..a434496 100644 --- a/roles/services/templates/z99-local.cnf +++ b/roles/services/templates/z99-local.cnf @@ -1,6 +1,6 @@ [mysqld] -server-id = 1 +server-id = {{ serverid }} #bind-address = 127.0.0.1 #event-scheduler = OFF #skip-log-bin