mirror of
https://github.com/RWejlgaard/pez-infra.git
synced 2026-05-06 04:14:43 +00:00
fix: bind mariadb to local ip
This commit is contained in:
parent
1ab278e47a
commit
ecc73ca60d
5 changed files with 21 additions and 1 deletions
|
|
@ -88,6 +88,7 @@
|
||||||
roles:
|
roles:
|
||||||
- role: docker_services
|
- role: docker_services
|
||||||
- role: systemd_services
|
- role: systemd_services
|
||||||
|
- role: mariadb
|
||||||
|
|
||||||
# london-a: Monitoring stack (FreeBSD — Prometheus, Grafana)
|
# london-a: Monitoring stack (FreeBSD — Prometheus, Grafana)
|
||||||
# Note: london-a uses FreeBSD; monitoring roles handle this via conditionals.
|
# Note: london-a uses FreeBSD; monitoring roles handle this via conditionals.
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,6 @@ docker_services:
|
||||||
- minecraft
|
- minecraft
|
||||||
- smartctl-exporter
|
- smartctl-exporter
|
||||||
|
|
||||||
# MaNGOS database backend — managed by apt, not Ansible
|
# MaNGOS database backend — installed by apt; config managed by mariadb role
|
||||||
system_packages_services:
|
system_packages_services:
|
||||||
- mariadb
|
- mariadb
|
||||||
|
|
|
||||||
5
ansible/roles/mariadb/files/bind-local.cnf
Normal file
5
ansible/roles/mariadb/files/bind-local.cnf
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
[mysqld]
|
||||||
|
# Restrict MariaDB to loopback only.
|
||||||
|
# UFW blocks port 3306 externally, but binding to 127.0.0.1 provides
|
||||||
|
# defense in depth — the socket never reaches the network stack at all.
|
||||||
|
bind-address = 127.0.0.1
|
||||||
5
ansible/roles/mariadb/handlers/main.yml
Normal file
5
ansible/roles/mariadb/handlers/main.yml
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
- name: Restart mariadb
|
||||||
|
ansible.builtin.systemd:
|
||||||
|
name: mariadb
|
||||||
|
state: restarted
|
||||||
9
ansible/roles/mariadb/tasks/main.yml
Normal file
9
ansible/roles/mariadb/tasks/main.yml
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
---
|
||||||
|
- name: Deploy MariaDB bind-address config
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: bind-local.cnf
|
||||||
|
dest: /etc/mysql/mariadb.conf.d/99-bind-local.cnf
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: '0644'
|
||||||
|
notify: Restart mariadb
|
||||||
Loading…
Add table
Reference in a new issue