Refs #8140: MariaDB Server Deploy - Role WIP

This commit is contained in:
Xavi Lleó 2024-11-29 10:51:36 +01:00
parent 8c88bd8a80
commit 6977f293e9
2 changed files with 36 additions and 2 deletions

View File

@ -13,6 +13,13 @@
with_fileglob:
- "files/z9*.cnf"
notify: restart-mariadb
- name: Ensure mariadb service override directory exists
file:
path: /etc/systemd/system/mariadb.service.d
state: directory
owner: root
group: root
mode: '0755'
- name: Set MariaDB custom service.d override.conf
copy:
src: mariadb_override.conf
@ -21,17 +28,24 @@
group: root
mode: u=rw,g=r,o=r
notify: restart-mariadb
- name: Ensure scripts root directory exists
file:
path: /root/scripts
state: directory
owner: root
group: root
mode: '0755'
- name: Set MariaDB custom root scripts
copy:
src: "{{ item }}"
dest: /root/scripts
dest: /root/scripts/
owner: root
group: root
mode: u=rwx,g=rx,o=rx
with_fileglob:
- "files/scripts/*.sh"
notify: restart-mariadb
- name: Set MariaDB README root scripts
- name: Set MariaDB README root script
copy:
src: files/scripts/README.md
dest: /root/scripts/README.md
@ -39,3 +53,19 @@
group: root
mode: u=rw,g=r,o=r
notify: restart-mariadb
- name: Set MariaDB performance and customize root script
copy:
src: files/scripts/mysqltuner.pl
dest: /root/scripts/mysqltuner.pl
owner: root
group: root
mode: u=rwx,g=rx,o=rx
notify: restart-mariadb
- name: Set MariaDB Cron to /etc/cron.d
copy:
src: templates/cron_mariadb
dest: /etc/cron.d/vn
owner: root
group: root
mode: u=rw,g=r,o=r
notify: restart-mariadb

View File

@ -0,0 +1,4 @@
MAILTO="{{ sysadmin_mail }}"
*/15 * * * * root /root/scripts/check-memory.sh
*/30 * * * * root /root/scripts/scheduler-log.sh