mirror of
https://github.com/RWejlgaard/pez-infra.git
synced 2026-05-06 04:14:43 +00:00
fix: bind mariadb to local ip (#62)
This commit is contained in:
parent
1ef59ccc4a
commit
49cee191b5
5 changed files with 21 additions and 1 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
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