8343-New-machine-id #48

Merged
xavi merged 40 commits from 8343-New-machine-id into main 2025-01-10 13:29:15 +00:00
2 changed files with 36 additions and 13 deletions
Showing only changes of commit 506fd6b341 - Show all commits

View File

@ -5,4 +5,7 @@
- name: restart-mariadb
systemd:
name: mariadb
- name: reload systemd
command:
cmd: systemctl daemon-reload

View File

@ -3,6 +3,31 @@
name: mariadb-server
state: present
#install_recommends: no
- name: Ensure log directory exists /var/log/mysql
file:
path: /var/log/mysql
state: directory
owner: mysql
group: adm
mode: u=rwx,g=rxs,o=
- name: Ensure mysqlbin directory exists /mnt/mysqlbin
file:
path: /mnt/mysqlbin
state: directory
owner: root
group: root
mode: u=rwx,g=rx,o=rx
- name: Ensure mysqltmp directory exists /mnt/mysqltmp with sticky bit
file:
path: /mnt/mysqltmp
state: directory
mode: u=rwx,g=rwx,o=rwxt
owner: root
group: root
- name: Set MariaDB custom configuration
copy:
src: "{{ item }}"
@ -13,6 +38,7 @@
with_fileglob:
- "files/z9*.cnf"
notify: restart-mariadb
- name: Ensure mariadb service override directory exists
file:
path: /etc/systemd/system/mariadb.service.d
@ -20,6 +46,7 @@
owner: root
group: root
mode: u=rwx,g=rx,o=rx
- name: Set MariaDB custom service.d override.conf
copy:
src: mariadb_override.conf
@ -27,7 +54,8 @@
owner: root
group: root
mode: u=rw,g=r,o=r
notify: restart-mariadb
notify: reload systemd
- name: Ensure scripts root directory exists
file:
path: /root/scripts
@ -35,6 +63,7 @@
owner: root
group: root
mode: u=rwx,g=rx,o=rx
- name: Set MariaDB custom root scripts
copy:
src: "{{ item }}"
@ -44,7 +73,7 @@
mode: u=rwx,g=rx,o=rx
with_fileglob:
- "files/scripts/*.sh"
notify: restart-mariadb
- name: Set MariaDB README root script
copy:
src: files/scripts/README.md
@ -52,7 +81,7 @@
owner: root
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
@ -60,15 +89,7 @@
owner: root
group: root
mode: u=rwx,g=rx,o=rx
notify: restart-mariadb
- name: Ensure log directory exists /var/log/mysql
file:
path: /var/log/mysql
state: directory
owner: mysql
group: adm
mode: u=rwx,g=rxs,o=
notify: restart-mariadb
- name: Set MariaDB Cron to /etc/cron.d
template:
src: templates/cron_mariadb
@ -76,4 +97,3 @@
owner: root
group: root
mode: u=rw,g=r,o=r
notify: restart-mariadb