diff --git a/playbooks/db.yml b/playbooks/db.yml new file mode 100644 index 0000000..b0436c5 --- /dev/null +++ b/playbooks/db.yml @@ -0,0 +1,5 @@ +- name: Configure DB + hosts: all + tasks: + - import_role: + name: db diff --git a/roles/db/defaults/main.yaml b/roles/db/defaults/main.yaml index 963cbe5..85bc205 100644 --- a/roles/db/defaults/main.yaml +++ b/roles/db/defaults/main.yaml @@ -1,4 +1,3 @@ -realm: "{{domain}}.{{host_domain}}" mariadb_base_packages: - mariadb-server - mariadb-backup @@ -19,7 +18,6 @@ required_directories: - { path: /root/mariabackup, owner: root, group: root, mode: 'u=rwx,g=rx,o=rx' } - { path: /mnt/mysqldata/mysql, owner: mysql, group: mysql, mode: 'u=rwx,g=rx,o=rx' } - { path: /etc/systemd/system/mariadb.service.d, owner: root, group: root, mode: 'u=rwx,g=rx,o=rx' } - required_files_and_mariabackup_files_and_root_scripts: - { src: "mariadb_override.conf", dest: "/etc/systemd/system/mariadb.service.d/override.conf", mode: "u=rw,g=r,o=r" } - { src: "mysql-flush.sh", dest: "/etc/qemu/fsfreeze-hook.d/mysql-flush.sh", mode: "u=rwx,g=rx,o=rx" } diff --git a/roles/db/files/mariabackup/restore-backup.sh b/roles/db/files/mariabackup/restore-backup.sh index 0673526..f8b612f 100644 --- a/roles/db/files/mariabackup/restore-backup.sh +++ b/roles/db/files/mariabackup/restore-backup.sh @@ -44,6 +44,7 @@ mariabackup \ --target-dir="$restoreDir" \ 2>> "$logFile" chown -R mysql:mysql "$dataDir" +chmod 755 "$dataDir" rm "$dataDir/mysql/slow_log."* rm "$dataDir/mysql/general_log."* diff --git a/roles/db/tasks/main.yml b/roles/db/tasks/main.yml index 1c02224..9bd454d 100644 --- a/roles/db/tasks/main.yml +++ b/roles/db/tasks/main.yml @@ -1,2 +1 @@ - import_tasks: mariadb.yml - tags: mariadb