From 994447329c108cc0b0b21e29dc77e7171a863842 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavi=20Lle=C3=B3=20Tom=C3=A1s?= Date: Tue, 28 Jan 2025 15:52:29 +0100 Subject: [PATCH] refs #8414 - Refactor paths --- roles/services/defaults/main.yaml | 4 +++- roles/services/tasks/mariadb.yml | 12 ++++++------ roles/services/templates/test-db_dev/apply.config.sh | 6 +++--- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/roles/services/defaults/main.yaml b/roles/services/defaults/main.yaml index 8784d55..0eaff75 100644 --- a/roles/services/defaults/main.yaml +++ b/roles/services/defaults/main.yaml @@ -34,10 +34,12 @@ required_directories: - { path: /root/scripts, owner: root, group: root, mode: 'u=rwx,g=rx,o=rx' } - { 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" } - - { src: "files/mariabackup/bacula-after.sh", dest: "/root/mariabackup/bacula-after.sh", mode: "u=rwx,g=rx,o=rx" } + - { src: "files/mariabackuptest_dev/bacula-after.sh", dest: "/root/mariabackup/bacula-after.sh", mode: "u=rwx,g=rx,o=rx" } - { src: "files/mariabackup/bacula-before.sh", dest: "/root/mariabackup/bacula-before.sh", mode: "u=rwx,g=rx,o=rx" } - { src: "files/mariabackup/config.sh", dest: "/root/mariabackup/config.sh", mode: "u=rwx,g=rx,o=x" } - { src: "files/mariabackup/inc-backup.sh", dest: "/root/mariabackup/inc-backup.sh", mode: "u=rwx,g=rx,o=rx" } diff --git a/roles/services/tasks/mariadb.yml b/roles/services/tasks/mariadb.yml index 225140c..b831a5c 100644 --- a/roles/services/tasks/mariadb.yml +++ b/roles/services/tasks/mariadb.yml @@ -71,7 +71,7 @@ # mode: u=rw,g=r,o=r - name: Insert MySQL certificates - no_log: true + #no_log: true copy: content: "{{ item.content }}" dest: "{{ item.dest }}" @@ -104,10 +104,10 @@ - /mnt/local-backup Make sure they are correctly configured and accessible. -- when: testdb is true or dev is true +- when: production is false block: - - name: Set MariaDB custom configuration Test-DB + - name: Set MariaDB custom configuration Test-DB-DEV copy: src: "{{ item }}" dest: /etc/mysql/mariadb.conf.d/ @@ -119,7 +119,7 @@ - "files/mariaconfigfiles/z92-testing_dev.cnf" notify: restart-mariadb - - name: Set MariaBackup custom template configuration Test-DB + - name: Set MariaBackup custom template configuration Test-DB-DEV template: src: test-db_dev/apply.config.sh dest: /root/mariabackup/ @@ -127,7 +127,7 @@ group: root mode: u=rw,g=,o= - - name: Set MariaDB local configuration file for Test-DB + - name: Set MariaDB local configuration file for Test-DB-DEV copy: src: files/mariabackuptest_dev/apply.sql dest: /root/mariabackup/ @@ -135,7 +135,7 @@ group: root mode: u=rw,g=r,o=r - - name: Reminder to check mount points environment Test-DB + - name: Reminder to check mount points environment Test-DB-DEV debug: msg: | Remember to check the following mount points: diff --git a/roles/services/templates/test-db_dev/apply.config.sh b/roles/services/templates/test-db_dev/apply.config.sh index f8cb310..8ac2677 100755 --- a/roles/services/templates/test-db_dev/apply.config.sh +++ b/roles/services/templates/test-db_dev/apply.config.sh @@ -4,10 +4,10 @@ baculaDir=/mnt/mysqldata/bacula-restore # Database branch name -dbBranch={{ environment }} +dbBranch={{ entorno }} # Database environment -dbEnvironment={{ environment }} +dbEnvironment={{ entorno }} # MariaDB cluster sibling node hostnames dbClusterSiblings=() @@ -16,5 +16,5 @@ dbClusterSiblings=() jenkinsAuth=jenkins:{{ lookup(passbolt, 'jenkinsAuth', folder_parent_id=passbolt_folder).password }} # Jenkins job URL -jenkinsUrl=https://jenkins.verdnatura.es/job/Scheduler/job/db-apply-changes-{{ environment }} +jenkinsUrl=https://jenkins.verdnatura.es/job/Scheduler/job/db-apply-changes-{{ entorno }}