fix: bind mariadb to local ip (#62)

This commit is contained in:
Rasmus Wejlgaard 2026-04-11 21:24:11 +01:00 committed by GitHub
parent 1ef59ccc4a
commit 49cee191b5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 21 additions and 1 deletions

View file

@ -88,6 +88,7 @@
roles:
- role: docker_services
- role: systemd_services
- role: mariadb
# london-a: Monitoring stack (FreeBSD — Prometheus, Grafana)
# Note: london-a uses FreeBSD; monitoring roles handle this via conditionals.

View file

@ -14,7 +14,7 @@ docker_services:
- minecraft
- smartctl-exporter
# MaNGOS database backend — managed by apt, not Ansible
# MaNGOS database backend — installed by apt; config managed by mariadb role
system_packages_services:
- mariadb

View 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

View file

@ -0,0 +1,5 @@
---
- name: Restart mariadb
ansible.builtin.systemd:
name: mariadb
state: restarted

View 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